Commit Graph
4571 Commits
Author SHA1 Message Date
Ming Yen HsiehandFelix Fietkau c166c4a0e7 wifi: mt76: mt7925: add auto regdomain switch support
Implement 802.11d-based automatic regulatory domain switching to
dynamically determine the regulatory domain at runtime.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-11-06 11:22:39 +00:00
Ming Yen HsiehandFelix Fietkau dac1d45fe9 wifi: mt76: mt7925: improve EHT capability control in regulatory flow
Move EHT flag handling into mt7925_regd_channel_update() to ensure
correct channel capability reporting.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-11-06 11:22:39 +00:00
Ming Yen HsiehandFelix Fietkau 588cc87bf6 wifi: mt76: mt7925: refactor regulatory notifier flow
Rename mt7925_regd_update() to mt7925_mcu_regd_update() to centralize
regd updates with error handling.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-11-06 11:22:39 +00:00
Ming Yen HsiehandFelix Fietkau f0e8fe4414 wifi: mt76: mt7925: refactor CLC support check flow
Move the disable_clc module parameter to regd.c and introduce
mt7925_regd_clc_supported() to centralize CLC support checks.

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-11-06 11:22:39 +00:00
Ming Yen HsiehandFelix Fietkau 0043147439 wifi: mt76: mt7925: refactor regulatory domain handling to regd.[ch]
Move regd logic to regd.c and regd.h files

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-11-06 11:22:39 +00:00
Alok TiwariandFelix Fietkau 8ff3b2bfc3 wifi: mt76: mt7996: fix typos in comments
Fix two minor comment typos in the mt7996 driver:
- "Tx/Tx" -> "Rx/Tx"
- "tnterrupt" -> "interrupt"

Signed-off-by: Alok Tiwari <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:54:43 +00:00
Lorenzo BianconiandFelix Fietkau 647d11bb17 wifi: mt76: mt7996: Add NPU offload support to MT7996 driver
Introduce Airoha NPU support to MT7996 driver. NPU is used to enable
traffic forward offloading between the MT76 NIC and the Airoha ethernet one
available on the Airoha EN7581 SoC using Netfilter Flowtable APIs.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:54:43 +00:00
Lorenzo BianconiandFelix Fietkau 141a815570 wifi: mt76: Introduce the NPU generic layer
Add the NPU generic layer in mt76 module. NPU will be used to enable
traffic forward offloading between the MT76 NIC and the Airoha ethernet one
available on the Airoha EN7581 SoC using Netfilter Flowtable APIs.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:54:43 +00:00
Lorenzo BianconiandFelix Fietkau a3b6c67c97 wifi: mt76: Add the capability to set TX token start ID
This is a preliminary patch to enable traffic forward offloading via the
Airoha NPU module available on the Airoha EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:48:48 +00:00
Lorenzo BianconiandFelix Fietkau 85e6517b0a wifi: mt76: Add mt76_dev pointer in mt76_queue struct.
This is a preliminary patch to enable traffic forward offloading via the
Airoha NPU module available on the Airoha EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:48:48 +00:00
Lorenzo BianconiandFelix Fietkau 05b3d899ad wifi: mt76: Move Q_READ/Q_WRITE definitions in dma.h
This is a preliminary patch to enable traffic forward offloading between
the MT76 NIC and the Airoha ethernet one via the Airoha NPU module
available on the Airoha EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:48:48 +00:00
Lorenzo BianconiandFelix Fietkau 0aece3089a wifi: mt76: mt7996: Remove useless check in mt7996_msdu_page_get_from_cache()
Get rid of useless null-pointer check in mt7996_msdu_page_get_from_cache
since we have already verfied the list is not empty.

Fixes: b1e58e137b616 ("wifi: mt76: mt7996: Introduce RRO MSDU callbacks")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/20251014-mt7996_msdu_page_get_from_cache-remove-null-ptr-check-v1-1-fbeb7881e192@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-30 11:48:48 +00:00
Felix Fietkau c63db0fcad wifi: mt76: mt7915: add WDS support when WED is enabled
The current WED only supports 256 wcid, whereas mt7986 can support up to
512 entries, so firmware provides a rule to get sta_info by DA when wcid
is set to 0x3ff by txd. Also, WED provides a register to overwrite txd
wcid, that is, wcid[9:8] can be overwritten by 0x3 and wcid[7:0] is set
to 0xff by host driver.

However, firmware is unable to get sta_info from DA as DA != RA for
4addr cases, so firmware and wifi host driver both use wcid (256 - 271)
and (768 ~ 783) for sync up to get correct sta_info.

Currently WDS+WED config is completely broken on MT7986/7981 devices if
without this patch.

Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Signed-off-by: Shengyu Qu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-20 16:09:22 +02:00
Peter ChiuandFelix Fietkau 2fe5bdbe7e wifi: mt76: use GFP_DMA32 for page_pool buffer allocation
Set GFP_DMA32 flag for page_pool buffers allocation since the hw relies
on 32-bit DMA addresses for WED offloading.

Tested-by: Daniel Pawlik <[email protected]>
Tested-by: Matteo Croce <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:51:05 +02:00
Lorenzo BianconiandFelix Fietkau 1e91eadc9d wifi: mt76: wed: use proper wed reference in mt76 wed driver callabacks
MT7996 driver can use both wed and wed_hif2 devices to offload traffic
from/to the wireless NIC. In the current codebase we assume to always
use the primary wed device in wed callbacks resulting in the following
crash if the hw runs wed_hif2 (e.g. 6GHz link).

[  297.455876] Unable to handle kernel read from unreadable memory at virtual address 000000000000080a
[  297.464928] Mem abort info:
[  297.467722]   ESR = 0x0000000096000005
[  297.471461]   EC = 0x25: DABT (current EL), IL = 32 bits
[  297.476766]   SET = 0, FnV = 0
[  297.479809]   EA = 0, S1PTW = 0
[  297.482940]   FSC = 0x05: level 1 translation fault
[  297.487809] Data abort info:
[  297.490679]   ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000
[  297.496156]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[  297.501196]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[  297.506500] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000107480000
[  297.512927] [000000000000080a] pgd=08000001097fb003, p4d=08000001097fb003, pud=08000001097fb003, pmd=0000000000000000
[  297.523532] Internal error: Oops: 0000000096000005 [#1] SMP
[  297.715393] CPU: 2 UID: 0 PID: 45 Comm: kworker/u16:2 Tainted: G           O       6.12.50 #0
[  297.723908] Tainted: [O]=OOT_MODULE
[  297.727384] Hardware name: Banana Pi BPI-R4 (2x SFP+) (DT)
[  297.732857] Workqueue: nf_ft_offload_del nf_flow_rule_route_ipv6 [nf_flow_table]
[  297.740254] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  297.747205] pc : mt76_wed_offload_disable+0x64/0xa0 [mt76]
[  297.752688] lr : mtk_wed_flow_remove+0x58/0x80
[  297.757126] sp : ffffffc080fe3ae0
[  297.760430] x29: ffffffc080fe3ae0 x28: ffffffc080fe3be0 x27: 00000000deadbef7
[  297.767557] x26: ffffff80c5ebca00 x25: 0000000000000001 x24: ffffff80c85f4c00
[  297.774683] x23: ffffff80c1875b78 x22: ffffffc080d42cd0 x21: ffffffc080660018
[  297.781809] x20: ffffff80c6a076d0 x19: ffffff80c6a043c8 x18: 0000000000000000
[  297.788935] x17: 0000000000000000 x16: 0000000000000001 x15: 0000000000000000
[  297.796060] x14: 0000000000000019 x13: ffffff80c0ad8ec0 x12: 00000000fa83b2da
[  297.803185] x11: ffffff80c02700c0 x10: ffffff80c0ad8ec0 x9 : ffffff81fef96200
[  297.810311] x8 : ffffff80c02700c0 x7 : ffffff80c02700d0 x6 : 0000000000000002
[  297.817435] x5 : 0000000000000400 x4 : 0000000000000000 x3 : 0000000000000000
[  297.824561] x2 : 0000000000000001 x1 : 0000000000000800 x0 : ffffff80c6a063c8
[  297.831686] Call trace:
[  297.834123]  mt76_wed_offload_disable+0x64/0xa0 [mt76]
[  297.839254]  mtk_wed_flow_remove+0x58/0x80
[  297.843342]  mtk_flow_offload_cmd+0x434/0x574
[  297.847689]  mtk_wed_setup_tc_block_cb+0x30/0x40
[  297.852295]  nf_flow_offload_ipv6_hook+0x7f4/0x964 [nf_flow_table]
[  297.858466]  nf_flow_rule_route_ipv6+0x438/0x4a4 [nf_flow_table]
[  297.864463]  process_one_work+0x174/0x300
[  297.868465]  worker_thread+0x278/0x430
[  297.872204]  kthread+0xd8/0xdc
[  297.875251]  ret_from_fork+0x10/0x20
[  297.878820] Code: 928b5ae0 8b000273 91400a60 f943fa61 (79401421)
[  297.884901] ---[ end trace 0000000000000000 ]---

Fix the issue detecting the proper wed reference to use running wed
callabacks.

Fixes: 83eafc9251d6 ("wifi: mt76: mt7996: add wed tx support")
Tested-by: Daniel Pawlik <[email protected]>
Tested-by: Matteo Croce <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:51:05 +02:00
Shayne ChenandFelix Fietkau 6f27d647c0 wifi: mt76: mt7915: add bf backoff limit table support
The commit 22b980badc0f ("mt76: add functions for parsing rate power limits
from DT") introduced generic support for rates limits in the devicetree.
But the mt7915 supports beamforming and has another table for configuring
the backoff limits. These can be configured in the DT with the paths-*
properties. The path-*-bf are the ones relevant for beamforming and the
ones without -bf suffix for "traditional" path backoff.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Sven Eckelmann (Plasma Cloud) <[email protected]>
Link: https://patch.msgid.link/20251007-backoff-table-support-v3-3-fd6e2684988f@simonwunderlich.de
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:49:20 +02:00
Sven Eckelmann (Plasma Cloud)andFelix Fietkau 95c4df3233 wifi: mt76: Fix DTS power-limits on little endian systems
The power-limits for ru and mcs and stored in the devicetree as bytewise
array (often with sizes which are not a multiple of 4). These arrays have a
prefix which defines for how many modes a line is applied. This prefix is
also only a byte - but the code still tried to fix the endianness of this
byte with a be32 operation. As result, loading was mostly failing or was
sending completely unexpected values to the firmware.

Since the other rates are also stored in the devicetree as bytewise arrays,
just drop the u32 access + be32_to_cpu conversion and directly access them
as bytes arrays.

Cc: [email protected]
Fixes: 22b980badc0f ("mt76: add functions for parsing rate power limits from DT")
Fixes: a9627d992b5e ("mt76: extend DT rate power limits to support 11ax devices")
Signed-off-by: Sven Eckelmann (Plasma Cloud) <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:49:14 +02:00
Thorsten BlumandFelix Fietkau 2e63c495f5 wifi: mt76: connac: Replace memcpy + hard-coded size with strscpy
Replace memcpy() and the hard-coded string length with strscpy() to
safely copy the string and improve mt76_connac_mcu_chip_config().

No functional changes.

Signed-off-by: Thorsten Blum <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:49:14 +02:00
Lorenzo BianconiandFelix Fietkau 754e335704 wifi: mt76: mt7996: Remove unnecessary link_id checks in mt7996_tx
Remove unnecessary link_id checks in mt7996_tx routine since if the link
identifier provided by mac80211 is unspecified the value will be
overwritten at the beginning on the function.

Fixes: f940c9b7aef6 ("wifi: mt76: mt7996: Set proper link destination address in mt7996_tx()")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:49:14 +02:00
Alok TiwariandFelix Fietkau 4e7077f774 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 <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://patch.msgid.link/[email protected]
2025-10-13 12:48:23 +02:00
Leon YenandFelix Fietkau c1349a686c 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: [email protected]
Fixes: fa6ad88e023d ("wifi: mt76: mt7921: fix country count limitation for CLC")
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 12:46:41 +02:00
Felix Fietkau fc25ba8219 add LICENSE file
Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 11:11:19 +02:00
Felix Fietkau 33f29d2345 wifi: mt76: relicense to BSD-3-Clause-Clear
MediaTek has asked to switch from the ISC license to BSD-3-Clause-Clear,
in order to improve clarity and the legal integrity of the code.

The BSD-3-Clause license includes the "no endorsement" clause, which is
important for protecting the reputation of the original authors and
contributors by preventing unauthorized use of their names for endorsement
purposes.

This clause is absent in the BSD-2-Clause license, which is more permissive
but lacks this specific protection.

This change also cleans up the license of some Kconfig/Makefile files,
which were accidentally marked as GPL.

The GPL 2.0 remains in use on mt76x0, as well as two source files in mt7615
for which the license situation still needs to be clarified.

Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 11:11:19 +02:00
Felix Fietkau 9050597c4c wifi: mt76: fix license/copyright of util.h
The extra copyright line for Ivo van Doorn and GPL license was only there
because of code that I had already removed before the initial upstream
submission of mt76.
Remove it and make this header file use ISC license like the rest of the
source files.

Signed-off-by: Felix Fietkau <[email protected]>
2025-10-13 11:11:19 +02:00
Christian Marangi ec3f05480e tools: CMakeLists: update cmake minimum required version to 3.10
New cmake version 4.0 requires at least 3.5 version as the minimum
required version with it increased to 3.10 in to-be-released cmake
versions.

Set the minimum required version to 3.10 to future-proof for future
cmake version.

Suggested-by: Hannu Nyman <[email protected]>
Signed-off-by: Christian Marangi <[email protected]>
2025-10-03 23:44:39 +02:00
Felix Fietkau 9ee788a382 wifi: mt76: mt7996: fix null pointer deref in mt7996_conf_tx()
If a link does not have an assigned channel yet, mt7996_vif_link returns
NULL. We still need to store the updated queue settings in that case, and
apply them later.
Move the location of the queue params to within struct mt7996_vif_link.

Fixes: c0df2f0caa8d ("wifi: mt76: mt7996: prepare mt7996_mcu_set_tx for MLO support")
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-29 13:16:01 +02:00
Nick MorrowandFelix Fietkau 6467af3bcf wifi: mt76: mt7921u: Add VID/PID for Netgear A7500
Add VID/PID 0846/9065 for Netgear A7500.

Reported-by: Autumn Dececco <[email protected]>
Tested-by: Autumn Dececco <[email protected]>
Signed-off-by: Nick Morrow <[email protected]>
Cc: [email protected]
Acked-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-15 09:52:25 +02:00
Rosen PenevandFelix Fietkau 9b770cb3da wifi: mt76: mt76_eeprom_override to int
mt76_eeprom_override has of_get_mac_address, which can return
-EPROBE_DEFER if the nvmem driver gets loaded after mt76 for some
reason.

Make sure this gets passed to probe so that nvmem mac overrides always
work.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-15 09:52:25 +02:00
Felix Fietkau d4a79d50ff wifi: mt76: mt7996: reset interface links on hardware restart
Free allocated memory

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 13:51:36 +02:00
Felix Fietkau 6745cece7a wifi: mt76: mt7996: reset station links on hardware restart
Ensure that all allocated memory is freed properly

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 13:51:36 +02:00
Felix Fietkau ddbe1f6eb2 wifi: mt76: abort scan/roc on hw restart
Avoid spurious channel changes and clean up allocated links

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 13:51:36 +02:00
Felix Fietkau d17519baab wifi: mt76: improve phy reset on hw restart
- fix number of station accounting for scanning code.
- reset channel context

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 13:51:36 +02:00
Howard HsuandFelix Fietkau a06461861f wifi: mt76: mt7996: fill User Priority in skb->priority for rx packets
Set UP in skb->priority to allow DSCP Learning at upper layers

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 13:05:40 +02:00
Peter ChiuandFelix Fietkau e88deeb145 wifi: mt76: mt7996: set VTA in txwi
Enable VTA flag in txwi to enable HQD in SPL which is needed by
the PST. Without this patch, PST cannot get the correct delay of
TxD and lead to a large latency.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 13:00:54 +02:00
Howard HsuandFelix Fietkau a9d21b7ece wifi: mt76: mt7996: remove the mem_total field of STA_REC_BF command
It is not used by the firmware.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 12:48:23 +02:00
Peter ChiuandFelix Fietkau fd4c0858e5 wifi: mt76: mt7996: disable promiscuous mode by default
Set MT_WF_RFCR_DROP_OTHER_UC by default and disable this flag in
mt7996_set_monitor only if monitor mode is enabled.

Without this patch, the MT_WF_RFCR_DROP_OTHER_UC would not be set so the
driver would receive lots of packets meant for other devices.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 12:41:40 +02:00
Felix Fietkau 1383b5548f wifi: mt76: use altx queue for offchannel tx on connac+
This ensures that packets are sent out immediately and are not held by
firmware internal buffering.

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 11:56:26 +02:00
Felix Fietkau bba7ae0b1a wifi: mt76: mt7996: drop connac mcu wtbl clear
The firmware does not support the command

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-11 10:28:24 +02:00
Felix Fietkau 5b0cbb0580 wifi: mt76: mt7996: fix updating beacon protection with beacons enabled
Disable and re-enable beacon after beacon protection key change, in order
to fully apply the changes.

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-10 17:59:04 +02:00
Felix Fietkau e995f6198d wifi: mt76: mt7996: fix key add/remove imbalance
Ensure that a key for a link is only added and removed once.
When bringing up a link, only upload keys for that particular link, instead
of iterating over all of them.

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-10 17:59:04 +02:00
Felix Fietkau 587012a433 wifi: mt76: mt7996: delete vif keys when requested
While deleting sta keys can be omitted in order to fix race conditions,
vif keys must be deleted before being replaced in order to prevent
accidental reuse in firmware.

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-10 17:59:04 +02:00
Felix Fietkau 75cd7c365b wifi: mt76: mt7996: fix memory leak on mt7996_mcu_sta_key_tlv error
Free the allocated skb on error

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-10 17:59:04 +02:00
Felix Fietkau 904abc93b7 wifi: mt76: mt7996: fix setting beacon protection keys
Include beacon key information in the STA_REC_UPDATE call.
Remove mt7996_mcu_get_pn - when installing a new key, we should
not reuse any existing PN value.

Signed-off-by: Allen Ye <[email protected]>
Signed-off-by: Michael-CY Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-10 17:58:46 +02:00
Felix Fietkau a6559a003d wifi: mt76: mt7996: decrease timeout for commonly issued MCU commands
This allows faster recovery from firmware issues.
Based on patch by Chad Monroe and ported from mt7915.

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 18:09:51 +02:00
Felix Fietkau ffda443265 wifi: mt76: mt7996: improve hardware restart reliability
Port latest version of similar changes from mt7915:
- use reconfig_complete to restart mac_work / queues
- reset full wtbl after firmware init
- clear wcid and vif mask to avoid leak
- fix sta poll list corruption
- clear rro list

Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 18:09:50 +02:00
Felix Fietkau a4d6f193be wifi: mt76: mt7996: remove redundant per-phy mac80211 calls during restart
There is only one wiphy, so extra calls must be removed.
For calls that need to remain per-wiphy, use mt7996_for_each_phy

Fixes: 69d54ce7491d ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 18:09:50 +02:00
Lorenzo BianconiandFelix Fietkau ea99986935 wifi: mt76: mt7996: Add missing DMA sync for EAPOL frames
Add missing DMA sync before updating EAPOL frames 802.11 addresses.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/20250909-mt7996-mlo-eapol-missing-dma-sync-v1-1-623924fdb875@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 18:07:56 +02:00
Howard HsuandFelix Fietkau b50c633f91 wifi: mt76: mt7996: support writing MAC TXD for AddBA Request
Support writing MAC TXD for the AddBA Req. Without this commit, the
start sequence number in AddBA Req will be unexpected value for MT7996
and MT7992. This can result in certain stations (e.g., AX200) dropping
packets, leading to ping failures and degraded connectivity. Ensuring
the correct MAC TXD and TXP helps maintain reliable packet transmission
and prevents interoperability issues with affected stations.

Signed-off-by: Howard Hsu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 18:07:40 +02:00
Ming Yen HsiehandFelix Fietkau 5776b32929 wifi: mt76: mt7925: refine the txpower initialization flow
Refactor the initialization and reset flow for tx power setting to
eliminate redundant configurations

Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 15:11:50 +02:00
Ming Yen HsiehandFelix Fietkau 015349622b 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: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 15:11:01 +02:00