Lorenzo Bianconi and Felix Fietkau
a87f63e269
wifi: mt76: mt7996: Remove unnecessary phy filed in mt7996_vif_link struct
...
Remove unnecessary phy pointer in mt7996_vif_link struct and rely on
mt7996_vif_link_phy() utility routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-4-7162b332873c@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-13 13:17:24 +00:00
Lorenzo Bianconi and Felix Fietkau
42964c80d2
wifi: mt76: mt7996: Fix deflink lookup adding links
...
Do not set vif deflink in mt7996_vif_link_add routine if the vif txq
pointer is NULL in order to not miss the mtxq wcid field update adding
a new link with a valid vif txq pointer.
Fixes: b25fd88d7133d ("wifi: mt76: mt7996: Set mtxq->wcid just for primary link")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-3-7162b332873c@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-13 13:16:11 +00:00
Lorenzo Bianconi and Felix Fietkau
754e3af4d1
wifi: mt76: mt7996: Fix deflink lookup removing links
...
Do not set vif deflink in mt7996_vif_link_remove routine if the vif txq
pointer is NULL in order to not miss the mtxq wcid field update adding
a new link with a valid vif txq pointer.
Fixes: 2e6bdd40e1d01 ("wifi: mt76: mt7996: Reset mtxq->idx if primary link is removed in mt7996_vif_link_remove()")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-2-7162b332873c@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-13 13:15:47 +00:00
Lorenzo Bianconi and Felix Fietkau
94017d560b
wifi: mt76: mt7996: Remove link pointer dependency in mt7996_mac_sta_remove_links()
...
Remove link pointer dependency in mt7996_mac_sta_remove_links routine to
get the mt7996_phy pointer since the link can be already offchannel
running mt7996_mac_sta_remove_links(). Rely on __mt7996_phy routine
instead.
Fixes: 344dd6a4c919 ("wifi: mt76: mt7996: Move num_sta accounting in mt7996_mac_sta_{add,remove}_links")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-1-7162b332873c@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-13 13:15:47 +00:00
Lorenzo Bianconi and Felix Fietkau
9f95baf93a
wifi: mt76: mt7996: Add missing CHANCTX_STA_CSA property
...
Enable missing CHANCTX_STA_CSA property required for MLO.
Fixes: f5160304d57c ("wifi: mt76: mt7996: Enable MLO support for client interfaces")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Reviewed-by: AngeloGioacchino Del Regno <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-05 17:18:07 +00:00
Lorenzo Bianconi and Felix Fietkau
ee84094d71
wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211()
...
Check frame length before accessing the mgmt fields in
mt76_connac2_mac_write_txwi_80211 in order to avoid a possible oob
access.
Fixes: 182071cdd594b ("mt76: connac: move connac2_mac_write_txwi in mt76_connac module")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-01 16:46:52 +00:00
Lorenzo Bianconi and Felix Fietkau
f29ff60301
wifi: mt76: mt7925: Fix possible oob access in mt7925_mac_write_txwi_80211()
...
Check frame length before accessing the mgmt fields in
mt7925_mac_write_txwi_80211 in order to avoid a possible oob access.
Fixes: c948b5da6bbec ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-01 16:46:52 +00:00
Lorenzo Bianconi and Felix Fietkau
aee736a27e
wifi: mt76: mt7996: Fix possible oob access in mt7996_mac_write_txwi_80211()
...
Check frame length before accessing the mgmt fields in
mt7996_mac_write_txwi_80211 in order to avoid a possible oob access.
Fixes: 98686cd21624c ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-03-01 16:46:52 +00:00
Lorenzo Bianconi and Felix Fietkau
bd9fb7ac97
wifi: mt76: Enable NPU support for MT7996 devices
...
Enable NPU offloading for MT7990 chipset.
Tested-by: Kang Yang <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
e826923c53
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
2bc891cc94
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
9ccd49d455
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
d78bce0a15
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
56334c1c9b
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
8a02211445
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
9e10bcac81
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
d7a79fcece
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
01575edfc3
wifi: mt76: mt7996: Add NPU support for MT7990 chipset
...
Introduce support for MT7990 chipset in MT7996 npu configuration
codebase.
Tested-by: Kang Yang <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
cdb32a658b
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
853eafe859
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
bc5529c123
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
8e94d3266b
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
5c67ef5088
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
86a0bf3441
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
e992ff8842
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 <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:56:18 +00:00
Lorenzo Bianconi and Felix Fietkau
7dd72bbd6f
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 <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:42:02 +00:00
Lorenzo Bianconi and Felix Fietkau
ffdbdcd396
wifi: mt76: set page_pool napi pointer for mmio devices
...
In order to recycle skbs in the page_pool "hot" cache in
napi_pp_put_page routine, set napi pointer for MMIO devices in
mt76_create_page_pool().
Signed-off-by: Lorenzo Bianconi <[email protected] >
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 11:31:47 +00:00
Lorenzo Bianconi and Felix Fietkau
11f24adb14
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 <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 10:35:06 +00:00
Lorenzo Bianconi and Felix Fietkau
c2b1d3ec94
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 <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 10:19:14 +00:00
Lorenzo Bianconi and Felix Fietkau
66fea566f1
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 <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 10:19:14 +00:00
Lorenzo Bianconi and Felix Fietkau
be3d1224cc
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 <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 10:19:14 +00:00
Lorenzo Bianconi and Felix Fietkau
21cb565607
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 <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2026-01-27 10:19:14 +00:00
Lorenzo Bianconi and Felix Fietkau
e2a5529fa1
wifi: mt76: mt7996: Add missing locking in mt7996_mac_sta_rc_work()
...
Grab the mt76 mutex running mt7996_mac_sta_rc_work() since it is
required by mt7996_mcu_add_rate_ctrl routine.
Fixes: 28d519d0d493a ("wifi: mt76: Move RCU section in mt7996_mcu_add_rate_ctrl_fixed()")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-11-18 10:04:59 +00:00
Lorenzo Bianconi and Felix Fietkau
3cdafc1b13
wifi: mt76: mt7996: skip ieee80211_iter_keys() on scanning link remove
...
mt7996_vif_link_remove routine is executed by mt76_scan_complete()
without holding the wiphy mutex triggering the following lockdep warning.
WARNING: CPU: 0 PID: 72 at net/mac80211/key.c:1029 ieee80211_iter_keys+0xe4/0x1a0 [mac80211]
CPU: 0 UID: 0 PID: 72 Comm: kworker/u32:2 Tainted: G S 6.18.0-rc5+ #27 PREEMPT(full)
Tainted: [S]=CPU_OUT_OF_SPEC
Hardware name: Default string Default string/SKYBAY, BIOS 5.12 02/15/2023
Workqueue: phy3 mt76_scan_work [mt76]
RIP: 0010:ieee80211_iter_keys+0xe4/0x1a0 [mac80211]
Code: 4c 48 83 c4 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3 48 8b 47 48 be ff ff ff ff 48 8d 78 68 e8 b4 eb 1e e1 85 c0 0f 85 49
ff ff ff 4c 8b ab 90 1a 00 00 48 8d 83 90
RSP: 0018:ffffc900002f7cb0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff888127e00ee0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff888127e00788 RDI: ffff88811132b5c8
RBP: ffffffffa0ddf400 R08: 0000000000000001 R09: 000000009dcc1dac
R10: 0000000000000001 R11: ffff88811132b5a0 R12: ffffc900002f7d00
R13: ffff8882581e6a80 R14: ffff888127e0afc8 R15: ffff888158832038
FS: 0000000000000000(0000) GS:ffff8884da486000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000030a0fd90 CR3: 0000000002c52004 CR4: 00000000003706f0
Call Trace:
<TASK>
? lock_acquire+0xc2/0x2c0
mt7996_vif_link_remove+0x64/0x2b0 [mt7996e]
mt76_put_vif_phy_link+0x41/0x50 [mt76]
mt76_scan_complete+0x77/0x100 [mt76]
mt76_scan_work+0x2eb/0x3f0 [mt76]
? process_one_work+0x1e5/0x6d0
process_one_work+0x221/0x6d0
worker_thread+0x19a/0x340
? rescuer_thread+0x450/0x450
kthread+0x108/0x220
? kthreads_online_cpu+0x110/0x110
ret_from_fork+0x1c6/0x220
? kthreads_online_cpu+0x110/0x110
ret_from_fork_asm+0x11/0x20
</TASK>
irq event stamp: 45471
hardirqs last enabled at (45477): [<ffffffff813d446e>] __up_console_sem+0x5e/0x70
hardirqs last disabled at (45482): [<ffffffff813d4453>] __up_console_sem+0x43/0x70
softirqs last enabled at (44500): [<ffffffff81f2ae0c>] napi_pp_put_page+0xac/0xd0
softirqs last disabled at (44498): [<ffffffff81fa32a0>] page_pool_put_unrefed_netmem+0x290/0x3d0
---[ end trace 0000000000000000 ]---
Fix the issue skipping ieee80211_iter_keys() for scanning links in
mt7996_vif_link_remove routine since we have not uploaded any hw keys
for these links.
Fixes: 04414d7bba78 ("wifi: mt76: mt7996: delete vif keys when requested")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Ben Greear <[email protected] >
Link: https://patch.msgid.link/20251115-mt7996-key-iter-link-remove-fix-v1-1-4f3f4e1eaa78@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2025-11-18 10:04:18 +00:00
Lorenzo Bianconi and Felix Fietkau
b01325c2d9
wifi: mt76: mt7996: skip deflink accounting for offchannel links
...
Do not take into account offchannel links for deflink accounting.
Fixes: a3316d2fc669f ("wifi: mt76: mt7996: set vif default link_id adding/removing vif links")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Ben Greear <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-11-15 09:23:11 +00:00
Lorenzo Bianconi and Felix Fietkau
5f29f4ca68
wifi: mt76: Move mt76_abort_scan out of mt76_reset_device()
...
Move mt76_abort_scan routine out of mt76_reset_device() in order to
avoid a possible deadlock since mt76_reset_device routine is running
with mt76 mutex help and mt76_abort_scan_complete() can grab mt76 mutex
in some cases.
Fixes: b36d55610215a ("wifi: mt76: abort scan/roc on hw restart")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Ben Greear <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-11-15 09:23:11 +00:00
Lorenzo Bianconi and Felix Fietkau
2650a7b63d
wifi: mt76: mt7996: move mt7996_update_beacons under mt76 mutex
...
Move mt7996_update_beacons routine inside mt76 mutex critical section
in mt7996_mac_reset_work() in order to run mt7996_vif_conf_link() in
mt7996_mcu_add_beacon routine.
Fixes: f30906c55a400 ("wifi: mt76: mt7996: disable beacons when going offchannel")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Ben Greear <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-11-15 09:23:11 +00:00
Lorenzo Bianconi and Felix Fietkau
7d17569dae
wifi: mt76: mt7996: grab mt76 mutex in mt7996_mac_sta_event()
...
Grab mt76 mutex in mt7996_mac_sta_event routine in order to rely on
mt76_dereference() utility macro.
Fixes: ecd72f9695e7e ("wifi: mt76: mt7996: Support MLO in mt7996_mac_sta_event()")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Ben Greear <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-11-15 09:23:11 +00:00
Lorenzo Bianconi and Felix 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 Bianconi and Felix 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 Bianconi and Felix 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 Bianconi and Felix 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 Bianconi and Felix 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 Bianconi and Felix 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
Lorenzo Bianconi and Felix 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
Lorenzo Bianconi and Felix 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
Lorenzo Bianconi and Felix 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
Lorenzo Bianconi and Felix Fietkau
7b4b6c8445
wifi: mt76: Convert mt76_wed_rro_ind to LE
...
Do not use bitmask in mt76_wed_rro_ind DMA descriptor in order to not
break endianness.
This patch is based on the following series:
https://lore.kernel.org/linux-wireless/[email protected] /T/#m8b488004d69036cd3672b9eeca8005a937ec0313
Fixes: 950d0abb5cd94 ("wifi: mt76: mt7996: add wed rx support")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/301d5f2982ddb729c876fb65f9ac2443ce3f5ff1.1757414621.git.lorenzo@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-09 15:08:35 +02:00
Lorenzo Bianconi and Felix Fietkau
0a32ae3cc2
wifi: mt76: Add mt76_dma_get_rxdmad_c_buf utility routione
...
Introduce mt76_dma_get_rxdmad_c_buf routine to process packets received
by HW-RRO v3.1 module.
This is a preliminary patch to introduce SW path for HW-RRO v3.1 module
available on MT7992 chipset.
Co-developed-by: Rex Lu <[email protected] >
Signed-off-by: Rex Lu <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
ac1bca4997
wifi: mt76: Add rx_queue_init callback
...
Introduce rx_queue_init DMA callback. This is a preliminary patch to
configure RRO RX queues and decouple RRO logic from WED support.
Co-developed-by: Rex Lu <[email protected] >
Signed-off-by: Rex Lu <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
f559eef156
wifi: mt76: mt7996: Fix RX packets configuration for primary WED device
...
In order to properly set the number of rx packets for primary WED device
if hif device is available, move hif pointer initialization before
running mt7996_mmio_wed_init routine.
Fixes: 83eafc9251d6d ("wifi: mt76: mt7996: add wed tx support")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
4f81d751b5
wifi: mt76: mt7996: Fix tx-queues initialization for second phy on mt7996
...
Fix the second phy tx queue initialization if hif device is not
available for MT7990 chipset.
Fixes: 83eafc9251d6d ("wifi: mt76: mt7996: add wed tx support")
Co-developed-by: Sujuan Chen <[email protected] >
Signed-off-by: Sujuan Chen <[email protected] >
Co-developed-by: Benjamin Lin <[email protected] >
Signed-off-by: Benjamin Lin <[email protected] >
Co-developed-by: Rex Lu <[email protected] >
Signed-off-by: Rex Lu <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
d0217732f9
wifi: mt76: Do not always enable NAPIs for WED RRO queues
...
Do not initialize NAPIs for WED RRO queues if WED is active.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
4a3a5a7d71
wifi: mt76: Remove q->ndesc check in mt76_dma_rx_fill()
...
Remove q->ndesc check in mt76_dma_rx_fill routine since this is already
done in mt76_dma_rx_fill_buf().
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
245f6ff460
wifi: mt76: Add reset_idx to reset_q mt76_queue_ops signature.
...
Remove __mt76_dma_queue_reset routine and use mt76_dma_queue_reset
directly instead in mt76_queue_ops struct.
This is a preliminary patch to enable WED support for MT7992 Kite
chipset supported by MT7996 driver.
Co-developed-by: Rex Lu <[email protected] >
Signed-off-by: Rex Lu <[email protected] >
Co-developed-by: Sujuan Chen <[email protected] >
Signed-off-by: Sujuan Chen <[email protected] >
Co-developed-by: Benjamin Lin <[email protected] >
Signed-off-by: Benjamin Lin <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 19:09:11 +02:00
Lorenzo Bianconi and Felix Fietkau
29bca0ca46
net: mediatek: wed: Introduce MT7992 WED support to MT7988 SoC
...
Introduce the second WDMA RX ring in WED driver for MT7988 SoC since the
Mediatek MT7992 WiFi chipset supports two separated WDMA rings.
Add missing MT7988 configurations to properly support WED for MT7992 in
MT76 driver.
Co-developed-by: Rex Lu <[email protected] >
Signed-off-by: Rex Lu <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected] >
2025-09-04 19:08:36 +02:00
Lorenzo Bianconi and Felix Fietkau
7cf18f8ebb
wifi: mt76: mt7996: Add all active links to poll list in mt7996_mac_tx_free()
...
Add all valid links to poll list for Airtime Fairness/AQL accounting when
tx-free event occurs.
Co-developed-by: Bo Jiao <[email protected] >
Signed-off-by: Bo Jiao <[email protected] >
Co-developed-by: Shayne Chen <[email protected] >
Signed-off-by: Shayne Chen <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-04 15:01:06 +02:00
Lorenzo Bianconi and Felix Fietkau
435e596914
wifi: mt76: mt7996: Use proper link info in mt7996_mcu_add_group
...
Do not always use default link in mt7996_mcu_add_group routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-02 19:56:52 +02:00
Lorenzo Bianconi and Felix Fietkau
15fa4e33ee
wifi: mt76: mt7996: Enable MLO support for client interfaces
...
Report MT7996 MLO STA capabilities to mac80211 stack.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-01 16:45:04 +02:00
Lorenzo Bianconi and Felix Fietkau
08df8dd7b0
wifi: mt76: mt7996: Use proper link_id in link_sta_rc_update callback
...
Do not always use deflink_id in link_sta_rc_update mac80211
callback but use the proper link_id provided by mac80211.
Fixes: 0762bdd30279f ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20250901-mt7996-fix-link_sta_rc_update-callback-v1-1-e24caf196222@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-01 16:45:04 +02:00
Lorenzo Bianconi and Felix Fietkau
95c9b8099e
wifi: mt76: mt7996: Set EML capabilities for AP interface
...
Report EML capabilities to hostapd for AP interface.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-01 16:45:04 +02:00
Lorenzo Bianconi and Felix Fietkau
27ad37728c
wifi: mt76: mt7996: Check phy before init msta_link in mt7996_mac_sta_add_links()
...
In order to avoid a possible NULL pointer dereference in
mt7996_mac_sta_init_link routine, move the phy pointer check before
running mt7996_mac_sta_init_link() in mt7996_mac_sta_add_links routine.
Fixes: dd82a9e02c054 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20250830-mt7996_mac_sta_add_links-fix-v1-1-4219fb8755ee@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2025-09-01 16:45:04 +02:00
Lorenzo Bianconi and Felix Fietkau
9bae5f956e
wifi: mt76: Remove dead code in mt76_scan_work
...
Duration can't be equal to 0 in mt76_scan_work routine so get rid of
related if condition.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-08-27 11:15:47 +02:00
Lorenzo Bianconi and Felix Fietkau
384d3a9bff
wifi: mt76: mt7996: Use deflink for AMPDU rx reordering
...
Packets belonging to the same TID can be sent over multiple links.
AMPDU rx reordering must be performed over all active links. Fix the
problem always using default link for AMPDU rx reordering.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-08-27 11:15:47 +02:00
Lorenzo Bianconi and Felix Fietkau
d1a2900a39
wifi: mt76: mt7996: Set proper link destination address in mt7996_tx()
...
Overwrite 802.11 destination address with in-use link address for MLD
capable VIFs in mt7996_tx routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Jose Ignacio Tornos Martinez <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-08-04 18:49:29 +02:00
Lorenzo Bianconi and Felix Fietkau
b3613d9a31
wifi: mt76: mt7996: Set def_wcid pointer in mt7996_mac_sta_init_link()
...
In order to get the ieee80211_sta pointer from wcid struct for a MLO
client, set def_wcid pointer in mt7996_mac_sta_init_link routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Jose Ignacio Tornos Martinez <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-08-04 18:49:29 +02:00
Lorenzo Bianconi and Felix Fietkau
110ecc3311
wifi: mt76: mt7996: Fix mt7996_mcu_bss_mld_tlv routine
...
Update mt7996_mcu_bss_mld_tlv routine to properly support MLO
configuring the BSS.
Fixes: 98686cd21624c ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-18 20:51:35 +02:00
Lorenzo Bianconi and Felix Fietkau
2601bb91e0
wifi: mt76: mt7996: Fix mt7996_mcu_sta_ba wcid configuration
...
Fix the wcid pointer used in mt7996_mcu_sta_ba routine to properly
support MLO scenario.
Fixes: 98686cd21624c ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-18 19:39:31 +02:00
Lorenzo Bianconi and Felix Fietkau
00275548ba
wifi: mt76: mt7996: Overwrite unspecified link_id in mt7996_tx()
...
Set link_id to msta or mvif primary value if it is set to
IEEE80211_LINK_UNSPECIFIED by mac80211 in mt7996_tx routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-18 19:39:31 +02:00
Lorenzo Bianconi and Felix Fietkau
a94166b21e
wifi: mt76: Get rid of dma_sync_single_for_device() for MMIO devices
...
Since the page_pool for MT76 MMIO devices are created with
PP_FLAG_DMA_SYNC_DEV flag, we do not need to sync_for_device each page
received from the pool since it is already done by the page_pool
codebase.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:05:04 +02:00
Lorenzo Bianconi and Felix Fietkau
2937786524
wifi: mt76: mt7996: Move num_sta accounting in mt7996_mac_sta_{add,remove}_links
...
Move phy num_sta accounting in mt7996_mac_sta_add() and
mt7996_mac_sta_remove() routines in order to take into account all
possibles MLO links.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
68dd28b99d
wifi: mt76: mt7996: Add MLO support to mt7996_tx_check_aggr()
...
Generalize mt7996_tx_check_aggr() and mt7996_txwi_free() routines to
introduce MLO support for MT7996 driver.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
afe63e7581
wifi: mt76: mt7996: Fix valid_links bitmask in mt7996_mac_sta_{add,remove}
...
sta->valid_links bitmask can be set even for non-MLO client.
Fixes: dd82a9e02c054 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
ffff9f71e2
wifi: mt76: mt7996: Fix possible OOB access in mt7996_tx()
...
Fis possible Out-Of-Boundary access in mt7996_tx routine if link_id is
set to IEEE80211_LINK_UNSPECIFIED
Fixes: 3ce8acb86b661 ("wifi: mt76: mt7996: Update mt7996_tx to MLO support")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
32f8c5849e
wifi: mt76: mt7996: Fix mlink lookup in mt7996_tx_prepare_skb
...
Use proper link_id in mt7996_tx_prepare_skb routine for mlink lookup.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
d71108eeda
wifi: mt76: mt7996: Do not set wcid.sta to 1 in mt7996_mac_sta_event()
...
msta_link->wcid.sta is already set to 1 in mt7996_mac_sta_init_link
routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
cf89b62180
wifi: mt76: mt7996: Rely on for_each_sta_active_link() in mt7996_mcu_sta_mld_setup_tlv()
...
Reuse for_each_sta_active_link utility macro in
mt7996_mcu_sta_mld_setup_tlv routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
7b3cd3274a
wifi: mt76: mt7996: Fix secondary link lookup in mt7996_mcu_sta_mld_setup_tlv()
...
Use proper link_id value for secondary link lookup in
mt7996_mcu_sta_mld_setup_tlv routine.
Fixes: 00cef41d9d8f5 ("wifi: mt76: mt7996: Add mt7996_mcu_sta_mld_setup_tlv() and mt7996_mcu_sta_eht_mld_tlv()")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-07-07 18:03:48 +02:00
Lorenzo Bianconi and Felix Fietkau
5603bd03d5
wifi: mt76: Remove RCU section in mt7996_mac_sta_rc_work()
...
Since mt7996_mcu_add_rate_ctrl() and mt7996_mcu_set_fixed_field() can't
run in atomic context, move RCU critical section in
mt7996_mcu_add_rate_ctrl() and mt7996_mcu_set_fixed_field(). This patch
fixes a 'sleep while atomic' issue in mt7996_mac_sta_rc_work().
Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Tested-by: Ben Greear <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-06-18 16:28:19 +02:00
Lorenzo Bianconi and Felix Fietkau
189532e383
wifi: mt76: Move RCU section in mt7996_mcu_add_rate_ctrl()
...
Since mt76_mcu_skb_send_msg() routine can't be executed in atomic context,
move RCU section in mt7996_mcu_add_rate_ctrl() and execute
mt76_mcu_skb_send_msg() in non-atomic context. This is a preliminary
patch to fix a 'sleep while atomic' issue in mt7996_mac_sta_rc_work().
Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-06-18 16:28:19 +02:00
Lorenzo Bianconi and Felix Fietkau
4f47d90943
wifi: mt76: Move RCU section in mt7996_mcu_add_rate_ctrl_fixed()
...
Since mt7996_mcu_set_fixed_field() can't be executed in a RCU critical
section, move RCU section in mt7996_mcu_add_rate_ctrl_fixed() and run
mt7996_mcu_set_fixed_field() in non-atomic context. This is a
preliminary patch to fix a 'sleep while atomic' issue in
mt7996_mac_sta_rc_work().
Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-06-18 16:28:19 +02:00
Lorenzo Bianconi and Felix Fietkau
656eb209ec
wifi: mt76: Move RCU section in mt7996_mcu_set_fixed_field()
...
Since mt76_mcu_skb_send_msg() routine can't be executed in atomic context,
move RCU section in mt7996_mcu_set_fixed_field() and execute
mt76_mcu_skb_send_msg() in non-atomic context. This is a preliminary
patch to fix a 'sleep while atomic' issue in mt7996_mac_sta_rc_work().
Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-06-18 16:28:19 +02:00
Lorenzo Bianconi and Felix Fietkau
f294304688
wifi: mt76: Assume __mt76_connac_mcu_alloc_sta_req runs in atomic context
...
Rely on GFP_ATOMIC flag in __mt76_connac_mcu_alloc_sta_req since it can
run in atomic context. This is a preliminary patch to fix a 'sleep while
atomic' issue in mt7996_mac_sta_rc_work().
Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-06-18 16:28:19 +02:00
Lorenzo Bianconi and Felix Fietkau
a403590fd4
Revert "wifi: mt76: Check link_conf pointer in mt76_connac_mcu_sta_basic_tlv()"
...
In mt76_connac_mcu_sta_basic_tlv() link_conf is always not NULL.
Revert the commit '9890624c1b39 ("wifi: mt76: Check link_conf pointer in
mt76_connac_mcu_sta_basic_tlv()")' in order to fix the following
warning:
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:394 mt76_connac_mcu_sta_basic_tlv()
warn: variable dereferenced before check 'link_conf'
This reverts commit 9890624c1b3948c1c7f1d0e19ef0bb7680b8c80d.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/20250325-mt76_connac_mcu_sta_basic_tlv-link_conf-revert-v1-1-b84efefb74ee@kernel.org
Signed-off-by: Felix Fietkau <[email protected] >
2025-05-21 14:30:01 +02:00
Lorenzo Bianconi and Felix Fietkau
d5cddf65f7
wifi: mt76: mt7996: Update mt7996_tx to MLO support
...
Rework mt7996_tx routine in order to support multi-link
setup.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
d01b9d300e
wifi: mt76: mt7996: rework mt7996_ampdu_action to support MLO
...
Active/de-active TX/RX BA sessssion for each active links running
mt7996_ampdu_action routine.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
974e6c2df9
wifi: mt76: mt7996: set vif default link_id adding/removing vif links
...
This info will be consumed by subsequent patches (e.g. in set/get tsf
routines).
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
d1a5a0afa6
wifi: mt76: mt7996: rework mt7996_net_fill_forward_path to support MLO
...
Rework mt7996_net_fill_forward_path routine in order to support multi-link
setup.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
b9682a51c1
wifi: mt76: mt7996: rework mt7996_update_mu_group to support MLO
...
Rework mt7996_update_mu_group routine in order to support multi-link
setup.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
057822770c
wifi: mt76: mt7996: rework mt7996_mac_sta_poll to support MLO
...
Rework mt7996_mac_sta_poll routine in order to support multi-link
setup.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
275e6a681b
wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO
...
Rework mt7996_mac_sta_rc_work routine in order to support multi-link
setup.
Co-developed-by: Bo Jiao <[email protected] >
Signed-off-by: Bo Jiao <[email protected] >
Co-developed-by: Peter Chiu <[email protected] >
Signed-off-by: Peter Chiu <[email protected] >
Co-developed-by: Shayne Chen <[email protected] >
Signed-off-by: Shayne Chen <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
60967d28a5
wifi: mt76: mt7996: rework mt7996_sta_hw_queue_read to support MLO
...
Extend mt7996_sta_hw_queue_read to support multi-link setup.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
a369b0c14d
wifi: mt76: mt7996: Add mt7996_sta_link to mt7996_mcu_add_bss_info signature
...
This is a preliminary patch to introduce MLO support for MT996 driver.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-19 13:05:59 +01:00
Lorenzo Bianconi and Felix Fietkau
d195324131
wifi: mt76: mt7996: Rely on mt7996_vif/sta_link in twt teardown
...
This is a preliminary patch to enable MLO for MT7996 driver
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:38:01 +01:00
Lorenzo Bianconi and Felix Fietkau
2efb26f1fc
wifi: mt76: mt7996: Support MLO in mt7996_mac_sta_event()
...
Similar to mt7996_mac_sta_add() adn mt7996_mac_sta_remove(), update
mt7996_mac_sta_event routine to take into account MLO support.
Please note mcu routines does not support MLO yet.
Co-developed-by: Bo Jiao <[email protected] >
Signed-off-by: Bo Jiao <[email protected] >
Co-developed-by: Peter Chiu <[email protected] >
Signed-off-by: Peter Chiu <[email protected] >
Co-developed-by: Shayne Chen <[email protected] >
Signed-off-by: Shayne Chen <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:38:01 +01:00
Lorenzo Bianconi and Felix Fietkau
46e20e5d74
wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks
...
Generalize mt7996_mac_sta_add() and mt7996_mac_sta_remove() routines to
deal with mt7996_sta_link structure.
This is a preliminary patch to introduce MLO support for MT7996 driver.
Co-developed-by: Bo Jiao <[email protected] >
Signed-off-by: Bo Jiao <[email protected] >
Co-developed-by: Peter Chiu <[email protected] >
Signed-off-by: Peter Chiu <[email protected] >
Co-developed-by: Shayne Chen <[email protected] >
Signed-off-by: Shayne Chen <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:38:01 +01:00
Lorenzo Bianconi and Felix Fietkau
3082c9edbe
wifi: mt76: mt7996: Add mt7996_sta_state routine
...
Introduce mt7996_sta_state routine in order to initialize wcid structure
in mt7996 codebase. This is a preliminary patch to enable MLO support in
MT7996 driver.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:38:01 +01:00
Lorenzo Bianconi and Felix Fietkau
f419c62e91
wifi: mt76: mt7996: Add link_info_changed callback
...
Convert bss_info_changed mac80211 callback in link_info_changed one.
This is a preliminary patch to enable MLO support in MT7996 driver.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:37:53 +01:00
Lorenzo Bianconi and Felix Fietkau
3e06380a43
wifi: mt76: mt7996: Add vif_cfg_changed callback
...
Introduce vif_cfg_changed mac80211 callback as preliminary patch to
enable MLO support in MT7996 driver.
Co-developed-by: Bo Jiao <[email protected] >
Signed-off-by: Bo Jiao <[email protected] >
Co-developed-by: Peter Chiu <[email protected] >
Signed-off-by: Peter Chiu <[email protected] >
Co-developed-by: Shayne Chen <[email protected] >
Signed-off-by: Shayne Chen <[email protected] >
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:37:42 +01:00
Lorenzo Bianconi and Felix Fietkau
915938e83c
wifi: mt76: mt7996: Add mt7996_sta_link struct in mt7996_vif_link
...
Introduce mt7996_sta_link field in mt7996_vif_link structure instead of
mt7996_sta. This is a preliminary patch to support MLO in MT7996 driver.
Signed-off-by: Lorenzo Bianconi <[email protected] >
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected] >
2025-03-12 10:37:15 +01:00