Leon Yen
84feb629fc
wifi: mt76: mt7925: introduce thermal protection
...
[ Upstream commit 1d81e893b422a6f0ae70f8648867c2e73edfb413 ]
Add thermal protection to prevent the chip from possible overheating
due to prolonged high traffic and adverse operating conditions.
Signed-off-by: Leon Yen <leon.yen@mediatek.com >
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250509082117.453819-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-27 11:11:29 +01:00
Samuel Williams
7f622bb3b5
wifi: mt76: mt7921: add 160 MHz AP for mt7922 device
...
[ Upstream commit 7011faebe543f8f094fdb3281d0ec9e1eab81309 ]
This allows mt7922 in hostapd mode to transmit up to 1.4 Gbps.
Signed-off-by: Samuel Williams <sam8641@gmail.com >
Link: https://patch.msgid.link/20250511005316.1118961-1-sam8641@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-27 11:11:29 +01:00
Henk Vergonet
e7a1865056
wifi: mt76: mt76x2: Add support for LiteOn WN4516R,WN4519R
...
[ Upstream commit 3c0e4f606d8693795a2c965d6f4987b1bfc31097 ]
Adds support for:
- LiteOn WN4516R
- LiteOn WN4519R
Both use:
- A nonstandard USB connector
- Mediatek chipset MT7600U
- ASIC revision: 76320044
Disabled VHT support on ASIC revision 76320044:
This fixes the 5G connectibity issue on LiteOn WN4519R module
see https://github.com/openwrt/mt76/issues/971
And may also fix the 5G issues on the XBox One Wireless Adapter
see https://github.com/openwrt/mt76/issues/200
I have looked at the FCC info related to the MT7632U chip as mentioned in here:
https://github.com/openwrt/mt76/issues/459
These confirm the chipset does not support 'ac' mode and hence VHT should be turned of.
Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com >
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Link: https://patch.msgid.link/20250418143914.31384-1-henk.vergonet@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-27 11:11:29 +01:00
Benjamin Lin
d4b93f9c2f
wifi: mt76: mt7996: drop fragments with multicast or broadcast RA
...
[ Upstream commit 80fda1cd7b0a1edd0849dc71403a070d0922118d ]
IEEE 802.11 fragmentation can only be applied to unicast frames.
Therefore, drop fragments with multicast or broadcast RA. This patch
addresses vulnerabilities such as CVE-2020-26145.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250515032952.1653494-4-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-27 11:11:28 +01:00
Michael Lo
7a20cdb55c
wifi: mt76: mt7925: fix host interrupt register initialization
...
commit ca872e0ad97159375da8f3d05cac1f48239e01d7 upstream.
ensure proper interrupt handling and aligns with the hardware spec by
updating the register offset for MT_WFDMA0_HOST_INT_ENA.
Cc: stable@vger.kernel.org
Fixes: c948b5da6b ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Michael Lo <michael.lo@mediatek.com >
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250509083512.455095-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-06-27 11:11:15 +01:00
Shayne Chen
7e48358639
wifi: mt76: mt7996: fix RX buffer size of MCU event
...
[ Upstream commit 42cb27af34de4acf680606fad2c1f2932110591f ]
Some management frames are first processed by the firmware and then
passed to the driver through the MCU event rings. In CONNAC3, event rings
do not support scatter-gather and have a size limitation of 2048 bytes.
If a packet sized between 1728 and 2048 bytes arrives from an event ring,
the ring will hang because the driver attempts to use scatter-gather to
process it.
To fix this, include the size of struct skb_shared_info in the MCU RX
buffer size to prevent scatter-gather from being used for event skb in
mt76_dma_rx_fill_buf().
Fixes: 98686cd216 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Co-developed-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250515032952.1653494-7-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:52 +02:00
Peter Chiu
3fc2021984
wifi: mt76: mt7996: set EHT max ampdu length capability
...
[ Upstream commit 8b2f574845e33d02e7fbad2d3192a8b717567afa ]
Set the max AMPDU length in the EHT MAC CAP. Without this patch, the
peer station cannot obtain the correct capability, which prevents
achieving peak throughput on the 2 GHz band.
Fixes: 1816ad9381e0 ("wifi: mt76: mt7996: add max mpdu len capability")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250515032952.1653494-3-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:52 +02:00
Michael Lo
ba9bf458fa
wifi: mt76: mt7925: ensure all MCU commands wait for response
...
[ Upstream commit aa97ff5782cf01cf2163593e1f57bbde63a06047 ]
Modify MCU command sending functions to wait for a response,
ensuring consistent behavior across all commands and improves
reliability by confirming that each command is processed
successfully.
Fixes: c948b5da6b ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Michael Lo <michael.lo@mediatek.com >
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250414013954.1151774-3-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:52 +02:00
Ming Yen Hsieh
52ffee9fea
wifi: mt76: mt7925: refine the sniffer commnad
...
[ Upstream commit bd02eebfc0b3502fe8322cf229b4c801416d1007 ]
Remove a duplicate call to `mt76_mcu_send_msg` to fix redundant operations
in the sniffer command handling.
Fixes: c948b5da6b ("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/20250414013954.1151774-2-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:51 +02:00
Ming Yen Hsieh
17e939897e
wifi: mt76: mt7925: prevent multiple scan commands
...
[ Upstream commit 122f270aca2c86d7de264ab67161c845e0691d73 ]
Add a check to ensure only one scan command is active at a time
by testing the MT76_HW_SCANNING state.
Fixes: c948b5da6b ("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/20250414013954.1151774-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:51 +02:00
Henry Martin
790d05cde3
wifi: mt76: mt7915: Fix null-ptr-deref in mt7915_mmio_wed_init()
...
[ Upstream commit efb95439c1477bbc955cacd0179c35e7861b437c ]
devm_ioremap() returns NULL on error. Currently, mt7915_mmio_wed_init()
does not check for this case, which results in a NULL pointer
dereference.
Prevent null pointer dereference in mt7915_mmio_wed_init().
Fixes: 4f831d18d1 ("wifi: mt76: mt7915: enable WED RX support")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com >
Link: https://patch.msgid.link/20250407061900.85317-1-bsdhenrymartin@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:51 +02:00
Henry Martin
1072fc0ca1
wifi: mt76: mt7996: Fix null-ptr-deref in mt7996_mmio_wed_init()
...
[ Upstream commit 8f30e2b059757d8711a823e4c9c023db62a1d171 ]
devm_ioremap() returns NULL on error. Currently, mt7996_mmio_wed_init()
does not check for this case, which results in a NULL pointer
dereference.
Prevent null pointer dereference in mt7996_mmio_wed_init()
Fixes: 83eafc9251 ("wifi: mt76: mt7996: add wed tx support")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com >
Link: https://patch.msgid.link/20250407032349.83360-1-bsdhenrymartin@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-06-19 15:31:51 +02:00
Quan Zhou
ac3af695c4
wifi: mt76: mt7925: fix fails to enter low power mode in suspend state
...
[ Upstream commit 2d5630b0c9466ac6549495828aa7dce7424a272a ]
The mt7925 sometimes fails to enter low power mode during suspend.
This is caused by the chip firmware sending an additional ACK event
to the host after processing the suspend command. Due to timing issues,
this event may not reach the host, causing the chip to get stuck.
To resolve this, the ACK flag in the suspend command is removed,
as it is not needed in the MT7925 architecture. This prevents the
firmware from sending the additional ACK event, ensuring the device
can reliably enter low power mode during suspend.
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com >
Link: https://patch.msgid.link/d056938144a3a0336c3a4e3cec6f271899f32bf7.1736775666.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-05-29 11:02:11 +02:00
Ming Yen Hsieh
8b526e4d94
wifi: mt76: mt7925: load the appropriate CLC data based on hardware type
...
[ Upstream commit f2027ef3f733d3f0bb7f27fa3343784058f946ab ]
Read the EEPROM to determine the hardware type and uses this to load the
correct CLC data.
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250304113649.867387-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-05-29 11:02:11 +02:00
Benjamin Lin
c9c64da88e
wifi: mt76: mt7996: revise TXS size
...
[ Upstream commit 593c829b4326f7b3b15a69e97c9044ecbad3c319 ]
Size of MPDU/PPDU TXS is 12 DWs.
In mt7996/mt7992, last 4 DWs are reserved, so TXS size was mistakenly
considered to be 8 DWs. However, in mt7990, 9th DW of TXS starts to be used.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com >
Link: https://patch.msgid.link/20250311103646.43346-1-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-05-29 11:02:10 +02:00
Rex Lu
1d58321192
wifi: mt76: mt7996: fix SER reset trigger on WED reset
...
[ Upstream commit 8d38abdf6c182225c5c0a81451fa51b7b36a635d ]
The firmware needs a specific trigger when WED is being reset due to an
ethernet reset condition. This helps prevent further L1 SER failure.
Signed-off-by: Rex Lu <rex.lu@mediatek.com >
Link: https://patch.msgid.link/20250311103646.43346-2-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-05-29 11:02:10 +02:00
Felix Fietkau
fa6c05122f
wifi: mt76: only mark tx-status-failed frames as ACKed on mt76x0/2
...
[ Upstream commit 0c5a89ceddc1728a40cb3313948401dd70e3c649 ]
The interrupt status polling is unreliable, which can cause status events
to get lost. On all newer chips, txs-timeout is an indication that the
packet was either never sent, or never acked.
Fixes issues with inactivity polling.
Link: https://patch.msgid.link/20250311103646.43346-6-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-05-29 11:02:10 +02:00
Fedor Pchelkin
2b81e76db3
wifi: mt76: disable napi on driver removal
...
commit 78ab4be549533432d97ea8989d2f00b508fa68d8 upstream.
A warning on driver removal started occurring after commit 9dd05df8403b
("net: warn if NAPI instance wasn't shut down"). Disable tx napi before
deleting it in mt76_dma_cleanup().
WARNING: CPU: 4 PID: 18828 at net/core/dev.c:7288 __netif_napi_del_locked+0xf0/0x100
CPU: 4 UID: 0 PID: 18828 Comm: modprobe Not tainted 6.15.0-rc4 #4 PREEMPT(lazy)
Hardware name: ASUS System Product Name/PRIME X670E-PRO WIFI, BIOS 3035 09/05/2024
RIP: 0010:__netif_napi_del_locked+0xf0/0x100
Call Trace:
<TASK>
mt76_dma_cleanup+0x54/0x2f0 [mt76]
mt7921_pci_remove+0xd5/0x190 [mt7921e]
pci_device_remove+0x47/0xc0
device_release_driver_internal+0x19e/0x200
driver_detach+0x48/0x90
bus_remove_driver+0x6d/0xf0
pci_unregister_driver+0x2e/0xb0
__do_sys_delete_module.isra.0+0x197/0x2e0
do_syscall_64+0x7b/0x160
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Tested with mt7921e but the same pattern can be actually applied to other
mt76 drivers calling mt76_dma_cleanup() during removal. Tx napi is enabled
in their *_dma_init() functions and only toggled off and on again inside
their suspend/resume/reset paths. So it should be okay to disable tx
napi in such a generic way.
Found by Linux Verification Center (linuxtesting.org).
Fixes: 2ac515a5d7 ("mt76: mt76x02: use napi polling for tx cleanup")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru >
Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250506115540.19045-1-pchelkin@ispras.ru
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-05-22 14:29:50 +02:00
Ming Yen Hsieh
00026f80c4
wifi: mt76: mt7925: fix the wrong simultaneous cap for MLO
...
commit 7dcea6fe33ee3d7cbb65baee0dd7adc76d1c9ddc upstream.
The mt7925 chip is only support a single radio, so the maximum
number of simultaneous should be 0.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Wang <sean.wang@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Tested-by: Caleb Jorden <cjorden@gmail.com >
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250305000851.493671-3-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-20 10:15:40 +02:00
Ming Yen Hsieh
374f2bf7b3
wifi: mt76: mt7925: fix the wrong link_idx when a p2p_device is present
...
commit 4bada9b0a29c185d45cc9512509edd6069fbfa79 upstream.
When the p2p device and MLO station are running concurrently, the p2p device
will occupy the wrong link_idx when the MLO secondary link is added.
Fixes: 9e4c3a007f01 ("wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Wang <sean.wang@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Tested-by: Caleb Jorden <cjorden@gmail.com >
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Link: https://patch.msgid.link/20250305000851.493671-2-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-20 10:15:40 +02:00
Ming Yen Hsieh
0dd6c62c13
wifi: mt76: mt7925: fix country count limitation for CLC
...
commit 6458d760a0c0afd2fda11e83ed3e1125a252432f upstream.
Due to the increase in the number of power tables for 6Ghz on CLC,
the variable nr_country is no longer sufficient to represent the
total quantity. Therefore, we have switched to calculating the
length of clc buf to obtain the correct power table.
Cc: stable@vger.kernel.org
Fixes: c948b5da6b ("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/20250116062131.3860198-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-20 10:15:40 +02:00
Ming Yen Hsieh
1706a07b38
wifi: mt76: mt7925: ensure wow pattern command align fw format
...
commit 8ae45b1f699bbc27ea8647093f794f671e77410b upstream.
Align the format of "struct mt7925_wow_pattern_tlv" with
firmware to ensure proper functionality.
Cc: stable@vger.kernel.org
Fixes: c948b5da6b ("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/20250116055925.3856856-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-20 10:15:39 +02:00
Haoxiang Li
ef44c9e811
wifi: mt76: Add check for devm_kstrdup()
...
commit 4bc1da524b502999da28d287de4286c986a1af57 upstream.
Add check for the return value of devm_kstrdup() in
mt76_get_of_data_from_mtd() to catch potential exception.
Fixes: e7a6a044f9 ("mt76: testmode: move mtd part to mt76_dev")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com >
Link: https://patch.msgid.link/20250219033645.2594753-1-haoxiang_li2024@163.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-20 10:15:39 +02:00
Icenowy Zheng
fe51630ba2
wifi: mt76: mt76x2u: add TP-Link TL-WDN6200 ID to device table
...
[ Upstream commit 06cccc2ebbe6c8a20f714f3a0ff3ff489d3004bb ]
The TP-Link TL-WDN6200 "Driverless" version cards use a MT7612U chipset.
Add the USB ID to mt76x2u driver.
Signed-off-by: Icenowy Zheng <uwu@icenowy.me >
Link: https://patch.msgid.link/20250317102235.1421726-1-uwu@icenowy.me
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-04-20 10:15:21 +02:00
Ming Yen Hsieh
0cfea60966
wifi: mt76: mt7921: fix kernel panic due to null pointer dereference
...
commit adc3fd2a2277b7cc0b61692463771bf9bd298036 upstream.
Address a kernel panic caused by a null pointer dereference in the
`mt792x_rx_get_wcid` function. The issue arises because the `deflink` structure
is not properly initialized with the `sta` context. This patch ensures that the
`deflink` structure is correctly linked to the `sta` context, preventing the
null pointer dereference.
BUG: kernel NULL pointer dereference, address: 0000000000000400
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: Oops: 0000 [#1 ] PREEMPT SMP NOPTI
CPU: 0 UID: 0 PID: 470 Comm: mt76-usb-rx phy Not tainted 6.12.13-gentoo-dist #1
Hardware name: /AMD HUDSON-M1, BIOS 4.6.4 11/15/2011
RIP: 0010:mt792x_rx_get_wcid+0x48/0x140 [mt792x_lib]
RSP: 0018:ffffa147c055fd98 EFLAGS: 00010202
RAX: 0000000000000000 RBX: ffff8e9ecb652000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff8e9ecb652000
RBP: 0000000000000685 R08: ffff8e9ec6570000 R09: 0000000000000000
R10: ffff8e9ecd2ca000 R11: ffff8e9f22a217c0 R12: 0000000038010119
R13: 0000000080843801 R14: ffff8e9ec6570000 R15: ffff8e9ecb652000
FS: 0000000000000000(0000) GS:ffff8e9f22a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000400 CR3: 000000000d2ea000 CR4: 00000000000006f0
Call Trace:
<TASK>
? __die_body.cold+0x19/0x27
? page_fault_oops+0x15a/0x2f0
? search_module_extables+0x19/0x60
? search_bpf_extables+0x5f/0x80
? exc_page_fault+0x7e/0x180
? asm_exc_page_fault+0x26/0x30
? mt792x_rx_get_wcid+0x48/0x140 [mt792x_lib]
mt7921_queue_rx_skb+0x1c6/0xaa0 [mt7921_common]
mt76u_alloc_queues+0x784/0x810 [mt76_usb]
? __pfx___mt76_worker_fn+0x10/0x10 [mt76]
__mt76_worker_fn+0x4f/0x80 [mt76]
kthread+0xd2/0x100
? __pfx_kthread+0x10/0x10
ret_from_fork+0x34/0x50
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1a/0x30
</TASK>
---[ end trace 0000000000000000 ]---
Reported-by: Nick Morrow <usbwifi2024@gmail.com >
Closes: https://github.com/morrownr/USB-WiFi/issues/577
Cc: stable@vger.kernel.org
Fixes: 90c10286b176 ("wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Tested-by: Salah Coronya <salah.coronya@gmail.com >
Link: https://patch.msgid.link/20250218033343.1999648-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-10 14:39:39 +02:00
Ming Yen Hsieh
339d6c965f
wifi: mt76: mt7925: remove unused acpi function for clc
...
commit b4ea6fdfc08375aae59c7e7059653b9877171fe4 upstream.
The code for handling ACPI configuration in CLC was copied from the mt7921
driver but is not utilized in the mt7925 implementation. So removes the
unused functionality to clean up the codebase.
Cc: stable@vger.kernel.org
Fixes: c948b5da6b ("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/20250304113649.867387-4-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-04-10 14:39:37 +02:00
Shayne Chen
a64cf55327
wifi: mt76: mt7915: add module param to select 5 GHz or 6 GHz on MT7916
...
commit 57af267d2b8f5d88485c6372761386d79c5e6a1a upstream.
Due to a limitation in available memory, the MT7916 firmware can only
handle either 5 GHz or 6 GHz at a time. It does not support runtime
switching without a full restart.
On older firmware, this accidentally worked to some degree due to missing
checks, but couldn't be supported properly, because it left the 6 GHz
channels uncalibrated.
Newer firmware refuses to start on either band if the passed EEPROM
data indicates support for both.
Deal with this limitation by using a module parameter to specify the
preferred band in case both are supported.
Fixes: b4d093e321 ("mt76: mt7915: add 6 GHz support")
Cc: stable@vger.kernel.org
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20241010083816.51880-1-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-02-17 10:05:15 +01:00
Nick Morrow
59dd56cf3b
wifi: mt76: mt7921u: Add VID/PID for TP-Link TXE50UH
...
commit 47d9a8ba1d7f31c674b6936b3c34ee934aa9b420 upstream.
Add VID/PID 35bc/0107 for recently released TP-Link TXE50UH USB WiFi adapter.
Tested-by: Shang Chieh Tseng <shangchieh.tseng@tsengsy.com >
Signed-off-by: Nick Morrow <usbwifi2024@gmail.com >
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/e797f105-9ca8-41e9-96de-7d25dec09943@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2025-02-17 10:05:14 +01:00
Peter Chiu
776fb8be52
wifi: mt76: mt7996: fix ldpc setting
...
[ Upstream commit da8352da1e4f476fdbf549a4efce4f3c618fde3b ]
The non-AP interfaces would not use conf->vht_ldpc so they never set
STA_CAP_VHT_LDPC even if peer-station support LDPC.
Check conf->vht_ldpc only for AP interface.
Without this patch, station only uses BCC to transmit packet in VHT mode.
Fixes: dda423dd65 ("wifi: mt76: mt7996: remove mt7996_mcu_beacon_check_caps()")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250114101026.3587702-7-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Benjamin Lin
2b7e4a8eef
wifi: mt76: mt7996: fix definition of tx descriptor
...
[ Upstream commit 14749fe2ed360c92c1a2a76dac0b77f759234981 ]
For mt7992 chipsets, the definition of TXD.DW6.BIT10~15 has different
interpretations on different frame types. Driver only needs to fill
MSDU_CNT for non-management frames.
Fixes: 408566db8c ("wifi: mt76: connac: add new definition of tx descriptor")
Co-developed-by: Shayne Chen <shayne.chen@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com >
Link: https://patch.msgid.link/20250114101026.3587702-6-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Benjamin Lin
0e9f49b97f
wifi: mt76: mt7996: fix incorrect indexing of MIB FW event
...
[ Upstream commit 5c2a25a1ab76a2976dddc5ffd58498866f3ef7c2 ]
Fix wrong calculation of the channel times due to incorrect
interpretation from the FW event.
Fixes: 98686cd216 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250114101026.3587702-4-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Howard Hsu
9afda07be0
wifi: mt76: mt7996: fix HE Phy capability
...
[ Upstream commit 7e3aef59a403ade5dd4ea02edc2d7138a66d74b6 ]
Set HE SU PPDU And HE MU PPDU With 4x HE-LTF And 0.8 us GI within HE PHY
Capabilities element as 1 since hardware can support.
Fixes: 98686cd216 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250114101026.3587702-3-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Howard Hsu
2c77d8e788
wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU
...
[ Upstream commit 2ffbdfc1bd78ba944c5754791c84f32232b513c6 ]
This commit includes two changes. First, enable "EHT MU PPDU With 4x
EHT-LTF And 0.8us GI" in EHT Phy capabilities element since hardware
can support. Second, fix the value of "Maximum number of supported
EHT LTFs" in the same element, where the previous setting of 3 in
Bit 3-4 was incorrect.
Fixes: 348533eb96 ("wifi: mt76: mt7996: add EHT capability init")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250114101026.3587702-2-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Peter Chiu
e6d5e6bdf0
wifi: mt76: mt7996: add max mpdu len capability
...
[ Upstream commit 1816ad9381e0c150e4c44ce6dd6ee2c52008a052 ]
Set max mpdu len to 11454 according to hardware capability.
Without this patch, the max ampdu length would be 3895 and count not get
expected performance.
Fixes: 348533eb96 ("wifi: mt76: mt7996: add EHT capability init")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com >
Link: https://patch.msgid.link/20250114101026.3587702-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Peter Chiu
aa9b8600e5
wifi: mt76: mt7996: fix register mapping
...
[ Upstream commit d07ecb4f7070e84de49e8fa4e5a83dd52716d805 ]
Bypass the entry when ofs is equal to dev->reg.map[i].size.
Without this patch, it would get incorrect register mapping when the CR
address is located at the boundary of an entry.
Fixes: 98686cd216 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Shengyu Qu <wiagn233@outlook.com >
Link: https://patch.msgid.link/OSZPR01MB84344FEFF53004B5CF40BCC198132@OSZPR01MB8434.jpnprd01.prod.outlook.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:21 +01:00
Peter Chiu
f1879d80be
wifi: mt76: mt7915: fix register mapping
...
[ Upstream commit dd1649ef966bb87053c17385ea2cfd1758f5385b ]
Bypass the entry when ofs is equal to dev->reg.map[i].size.
Without this patch, it would get incorrect register mapping when the CR
address is located at the boundary of an entry.
Fixes: cd4c314a65 ("mt76: mt7915: refine register definition")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com >
Signed-off-by: Shengyu Qu <wiagn233@outlook.com >
Link: https://patch.msgid.link/OSZPR01MB843401EAA1DA6BD7AEF356F298132@OSZPR01MB8434.jpnprd01.prod.outlook.com
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:20 +01:00
Felix Fietkau
f1f0bc58d9
wifi: mt76: mt7915: fix omac index assignment after hardware reset
...
[ Upstream commit cd043bbba6f9b71ebe0781d1bd2107565363c4b9 ]
Reset per-phy mac address slot mask in order to avoid leaking entries.
Fixes: 8a55712d12 ("wifi: mt76: mt7915: enable full system reset support")
Link: https://patch.msgid.link/20241230194202.95065-12-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:20 +01:00
Felix Fietkau
bb79a37d12
wifi: mt76: mt7915: firmware restart on devices with a second pcie link
...
[ Upstream commit 9b60e2ae511c959024ecf6578b3fbe85cd06d7cc ]
It seems that the firmware checks the register used for detecting matching
PCIe links in order to figure out if a secondary PCIe link is enabled.
Write the register again just before starting the firmware on hw reset,
in order to fix an issue that left the second band unusable after restart.
Fixes: 9093cfff72 ("mt76: mt7915: add support for using a secondary PCIe link for gen1")
Link: https://patch.msgid.link/20241230194202.95065-11-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:20 +01:00
Felix Fietkau
c8f27e3695
wifi: mt76: only enable tx worker after setting the channel
...
[ Upstream commit 228bc0e79c85269d36cc81e0288e95f2f9ba7ae1 ]
Avoids sending packets too early
Fixes: 0b3be9d1d3 ("wifi: mt76: add separate tx scheduling queue for off-channel tx")
Link: https://patch.msgid.link/20241230194202.95065-8-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:20 +01:00
Felix Fietkau
fdef354b05
wifi: mt76: mt7996: fix rx filter setting for bfee functionality
...
[ Upstream commit 858fd2a53877b2e8b1d991a5a861ac34a0f55ef8 ]
Fix rx filter setting to prevent dropping NDPA frames. Without this
change, bfee functionality may behave abnormally.
Fixes: 98686cd216 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Link: https://patch.msgid.link/20241230194202.95065-5-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:20 +01:00
Ming Yen Hsieh
80bce89566
wifi: mt76: mt7925: Properly handle responses for commands with events
...
[ Upstream commit 349460913a4d029cc37c9e3817b1903233b4a627 ]
Properly retrieve the response for commands with events. Ensure accurate
handling of event-driven commands.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-17-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:20 +01:00
Ming Yen Hsieh
4c58e49dd9
wifi: mt76: mt7925: Cleanup MLO settings post-disconnection
...
[ Upstream commit 816161051a039eeb1226fc85e2b38389f508906c ]
Clean up MLO settings after disconnection.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-16-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:19 +01:00
Ming Yen Hsieh
bc59dd02af
wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO
...
[ Upstream commit eb2a9a12c6092a26f632468d6610497d4f0e40da ]
Update mt7925_mcu_uni_[tx,rx]_ba for MLO support in firmware.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-15-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:19 +01:00
Ming Yen Hsieh
d786a67a28
wifi: mt76: mt7925: Init secondary link PM state
...
[ Upstream commit 28045ef2bc5bbeec4717da98bf31aca0faaccf02 ]
Initialize secondary link PM state.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-14-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:19 +01:00
Ming Yen Hsieh
24ff9b82f8
wifi: mt76: mt7925: Update secondary link PS flow
...
[ Upstream commit 8dafab9c4116a6a4fd870be03a3d9b66771dc5a8 ]
Update the power-saving flow for secondary links.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-13-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:19 +01:00
Ming Yen Hsieh
12f1394600
wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS
...
[ Upstream commit 30b721467c9c2510e26af6e78e92d7cc08a14bc4 ]
Update mt7925_unassign_vif_chanctx to support per-link BSS.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-12-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:19 +01:00
Ming Yen Hsieh
3fe7acc6f4
wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA
...
[ Upstream commit 90c10286b176421068b136da51ed83059a68e322 ]
Update mt792x_rx_get_wcid to support per-link STA.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-11-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:19 +01:00
Ming Yen Hsieh
848276d8b3
wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state
...
[ Upstream commit 0e02f6ed6a49577e29e0b1f7900fad3ed8ae870c ]
Update mt7925_mcu_sta_update for broadcast (BC) in the ASSOC state.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-10-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:18 +01:00
Ming Yen Hsieh
0443ed06cf
wifi: mt76: Enhance mt7925_mac_link_sta_add to support MLO
...
[ Upstream commit e6803d39a8aa59e557402a541a97ee04b06c49b2 ]
Enhance mt7925_mac_link_sta_add to support MLO.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-9-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:18 +01:00
Ming Yen Hsieh
89355c2a06
wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO
...
[ Upstream commit ac03e5b82bc6b44e8ea3e7c7c624ee1445ff4e4b ]
In mt7925_mac_link_bss_add(), the mt76_connac_mcu_uni_add_dev() function
must be executed only after all parameters have been properly initialized.
Fixes: 86c051f2c4 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com >
Signed-off-by: Sean Wang <sean.wang@mediatek.com >
Link: https://patch.msgid.link/20241211011926.5002-8-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2025-02-08 09:57:18 +01:00