Commit Graph
4291 Commits
Author SHA1 Message Date
Henk VergonetandFelix Fietkau 3dee73c357 wifi: mt76x2: Add support for LiteOn WN4516R,WN4519R
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 <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:15:38 +02:00
Christophe JAILLETandFelix Fietkau e285cb42be wifi: mt76: Remove an unneeded local variable in mt76x02_dma_init()
Remove 't' which is unneeded since commit f3950a414143 ("mt76: set
txwi_size according to the driver value")

This slightly simplifies the code.

Signed-off-by: Christophe JAILLET <[email protected]>
Link: https://patch.msgid.link/e86d5602bdd8b6bd22258ee69536992f39470bf5.1744928865.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:12:20 +02:00
Qasim IjazandFelix Fietkau 29363a6691 wifi: mt76: mt7996: prevent uninit return in mt7996_mac_sta_add_links
If link_conf_dereference_protected() or mt7996_vif_link()
or link_sta_dereference_protected() fail the code jumps to
the error_unlink label and returns ret which is uninitialised.

Fix this by setting err before jumping to error_unlink.

Fixes: c7e4fc362443 ("wifi: mt76: mt7996: Update mt7996_mcu_add_sta to MLO support")
Fixes: dd82a9e02c05 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks")
Signed-off-by: Qasim Ijaz <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-21 14:10:11 +02:00
Ming Yen HsiehandFelix Fietkau d7a070e11d wifi: mt76: mt7925: fix missing hdr_trans_tlv command for broadcast wtbl
Ensure that the hdr_trans_tlv command is included in the broadcast wtbl to
prevent the IPv6 and multicast packet from being dropped by the chip.

Cc: [email protected]
Fixes: cb1353ef3473 ("wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd")
Reported-by: Benjamin Xiao <[email protected]>
Tested-by: Niklas Schnelle <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://lore.kernel.org/lkml/EmWnO5b-acRH1TXbGnkx41eJw654vmCR-8_xMBaPMwexCnfkvKCdlU5u19CGbaapJ3KRu-l3B-tSUhf8CCQwL0odjo6Cd5YG5lvNeB-vfdg=@pm.me/
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-15 11:56:11 +02:00
Fedor PchelkinandFelix Fietkau fdfe9eca64 wifi: mt76: disable napi on driver removal
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: 2ac515a5d74f ("mt76: mt76x02: use napi polling for tx cleanup")
Cc: [email protected]
Signed-off-by: Fedor Pchelkin <[email protected]>
Tested-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-05-15 11:56:11 +02:00
Shayne ChenandFelix Fietkau 55218e6360 Revert "wifi: mt76: mt7996: fill txd by host driver"
This reverts commit 3b522cadedfe6e9e0e8193d7d4ab5aa8d0c73209.

The MTK connac3 has introduced new hardware, SDO (Software Defined
Offload), to offload the process of filling the TX descriptor. Initially,
there were some issues, but after several fixes, it should now be stable,
allowing us to revert this commit.

Additionally, activating SDO is essential for the proper functioning of
features like TX checksum offload.

Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-16 17:13:03 +02:00
Charles HanandFelix Fietkau be28ef77e3 wifi: mt76: mt7996: Add NULL check in mt7996_thermal_init
devm_kasprintf() can return a NULL pointer on failure,but this
returned value in mt7996_thermal_init() is not checked.
Add NULL check in mt7996_thermal_init(), to handle kernel NULL
pointer dereference error.

Fixes: 69d54ce7491d ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: Charles Han <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 11:07:15 +02:00
Allan WangandFelix Fietkau 0433adc883 wifi: mt76: mt7925: add EHT preamble puncturing
Add mt7925 EHT preamble puncturing.

Signed-off-by: Allan Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 11:07:15 +02:00
Dan CarpenterandFelix Fietkau b0cf33e76a wifi: mt76: mt7925: Fix logical vs bitwise typo
This was supposed to be & instead of &&.

Fixes: f0317215b367 ("wifi: mt76: mt7925: add EHT control support based on the CLC data")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 11:07:14 +02:00
StanleyYP WangandFelix Fietkau a19543c7e0 wifi: mt76: mt7996: rework radar HWRDD idx
The definition of MT_RX_SEL (for rdd_rx_sel) is mixed with the
definition of HWRDD idx.
For example, MT_RX_SEL2 is for background HWRDD idx, not an
option of rdd_rx_sel.
Additionally, HWRDD idx does not exactly map to band idx for
Connac 3 chips. So, add mt7996_get_rdd_idx as a helper function.

Finally, remove some parts of the code inherited from the legacy chips.
For instance,
1. rdd_state is used for single-band-dual-HWRDD chips (for 80+80),
especially the 76xx series.
2. rdd_rx_sel is also used for single-band-dual-HWRDD chips
rx_sel = 0 => RDD0 for WF0, RDD1 for WF2
rx_sel = 1 => RDD0 for WF1, RDD1 for WF3

Chip Variants              | 5G rdd idx     | Background rdd idx
---------------------------|----------------|-------------------
MT7996 (except 205/255)    | 1              | 2
MT7992                     | 1              | 2
MT7990                     | 1              | 2

Signed-off-by: StanleyYP Wang <[email protected]>
Reviewed-by: Shayne Chen <[email protected]>
Reviewed-by: Money Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:40:33 +02:00
StanleyYP WangandFelix Fietkau 9bacdb2bf2 wifi: mt76: mt7915: rework radar HWRDD idx
The definition of MT_RX_SEL (for rdd_rx_sel) is mixed with the
definition of HWRDD idx.
For example, MT_RX_SEL2 is for background HWRDD idx, not an option
of rdd_rx_sel.
Therefore, add mt7915_get_rdd_idx as a helper function to get the
HWRDD idx for each variants.

Additionally, remove some parts of the code inherited from the legacy
chips.
For instance,
1. rdd_state is used for single-band-dual-HWRDD chips (for 80+80),
especially the 76xx series.
2. rdd_rx_sel is also used for single-band-dual-HWRDD chips
rx_sel = 0 => RDD0 for WF0, RDD1 for WF2
rx_sel = 1 => RDD0 for WF1, RDD1 for WF3

Chip Variants                  | 5G rdd idx(=bandidx)| Background rdd idx
-------------------------------|---------------------|-------------------
MT7915A                        | 0                   | 2
MT7915D                        | 1                   | 2
MT7916 2G + 5G (2T2R+1R)       | 1                   | 2
MT7916 2G + 5G (3T3R)          | 1                   | N/A
MT7981 2G + 5G                 | 1                   | N/A
MT7986 2G + 5G (one adie DBDC) | 1                   | N/A
MT7986 5G (one adie)           | 1 (bandidx=MT_BAND1)| N/A
MT7986 2G + 5G (dual adie)     | 1                   | N/A

Signed-off-by: StanleyYP Wang <[email protected]>
Reviewed-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:40:33 +02:00
StanleyYP WangandFelix Fietkau 3cec186474 wifi: mt76: mt7915: set correct background radar capability
Some of the variants do not support background radar, so add a
helper to report background radar capability.
For mt7916, only the variant of 5G 2T2R + 1R supports background
radar.

Signed-off-by: StanleyYP Wang <[email protected]>
Reviewed-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:40:33 +02:00
Peter ChiuandFelix Fietkau f8c3dd3677 wifi: mt76: mt7996: add PCI device id for mt7990
Add PCI device IDs to enable support for mt7990 chipsets.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
StanleyYP WangandFelix Fietkau bc588ac3d1 wifi: mt76: mt7996: rework background radar check for mt7990
The MT7990 comes in 2T2R and 3T3R variants, with only the 2T2R supporting
background radar.

Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
Shayne ChenandFelix Fietkau 10c3ea97a8 wifi: mt76: connac: rework TX descriptor and TX free for mt7990
Adjust the TX descriptor and TX free for updated hardware fields.
This is a preliminary patch to support mt7990 chipset.

Co-developed-by: StanleyYP Wang <[email protected]>
Signed-off-by: StanleyYP Wang <[email protected]>
Co-developed-by: Benjamin Lin <[email protected]>
Signed-off-by: Benjamin Lin <[email protected]>
Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
Peter ChiuandFelix Fietkau d0799f3303 wifi: mt76: mt7996: adjust HW capabilities for mt7990
This is a preliminary patch to support mt7990 chipset.

Co-developed-by: Howard Hsu <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
StanleyYP WangandFelix Fietkau 51db7a2d57 wifi: mt76: mt7996: add eeprom support for mt7990
Add eeprom definition and default bin file for mt7990.
This is a preliminary patch to support mt7990 chipset.

Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
StanleyYP WangandFelix Fietkau a8def214d7 wifi: mt76: mt7996: rework register mapping for mt7990
Rework register offset and l1/l2/cbtop mapping for mt7990.
This is a preliminary patch to support mt7990 chipset.

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: StanleyYP Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
Peter ChiuandFelix Fietkau 6243414a4e wifi: mt76: mt7996: rework DMA configuration for mt7990
Modify DMA ring setting for mt7990.
This is a preliminary patch to support mt7990 chipset.

Co-developed-by: StanleyYP Wang <[email protected]>
Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
Peter ChiuandFelix Fietkau 3908cf04aa wifi: mt76: mt7996: rework WA mcu command for mt7990
Since mt7990 lacks WA firmware, some WA commands are not supported or
need to be refactored to use the SDO command.
This is a preliminary patch to support mt7990 chipset.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
StanleyYP WangandFelix Fietkau a2dd2f7896 wifi: mt76: connac: add support to load firmware for mt7990
Add firmware download support. Note that mt7990 does not have WA and DSP
firmwares. This is a preliminary patch to support mt7990 chipset.

Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
Shayne ChenandFelix Fietkau 63a4edf1cb wifi: mt76: mt7996: add macros for pci decive id
The chipset name (i.e., brand name) used by the driver may cause confusion
with the PCI device ID when adding support for new chipsets.

| Chipset name | PCI device id  |
|--------------|----------------|
| 7996         | 0x7990, 0x7991 |
| 7992         | 0x7992, 0x799a |
| 7990         | 0x7993, 0x799b |

To prevent confusion, replace the code that directly uses the device ID
with macros. This is a preliminary patch to support mt7990 chipset.

Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-04-11 10:29:38 +02:00
Johannes BergandFelix Fietkau de635e1e3a wifi: mt76: mt7996: fix locking in mt7996_mac_sta_rc_work()
The 'continue' statements need to be under spinlock, since
the spinlock needs to be held as a loop invariant.

Fixes: 0762bdd30279 ("wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO")
Signed-off-by: Johannes Berg <[email protected]>
2025-03-20 10:35:27 +01:00
Felix Fietkau 46f3a10a9f mt76: mt7925: sync with upstream cleanups
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:21:34 +01:00
Icenowy ZhengandFelix Fietkau 5169d4e866 wifi: mt76: mt76x2u: add TP-Link TL-WDN6200 ID to device table
The TP-Link TL-WDN6200 "Driverless" version cards use a MT7612U chipset.

Add the USB ID to mt76x2u driver.

Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:11:43 +01:00
Ming Yen HsiehandFelix Fietkau 0994f0af63 wifi: mt76: mt7925: fix the incomplete revert of [tx,rx]_ba for MLO
Since the `Revert wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO`
was not completely clean, submit this patch to fully clean it up.

Cc: [email protected]
Fixes: 73915469c55a ("Revert "wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO"")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:10:34 +01:00
Ming Yen HsiehandFelix Fietkau a826fc2874 wifi: mt76: mt7925: update MLO cleanup flow during disconnection
Refine the disconnection cleanup process for MLO. It introduces a dedicated
function to handle device removal, ensuring proper resource cleanup for both
BSS and device information.

Fixes: 21e40c17361e ("wifi: mt76: mt7925: adjust rm BSS flow to prevent next connection failure")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:09:49 +01:00
Ming Yen HsiehandFelix Fietkau a1ed21a669 wifi: mt76: mt792x: re-register CHANCTX_STA_CSA only for the mt7921 series
CSA is currently not supported on mt7925, so CSA is only registered for
the mt7921 series

Cc: [email protected]
Fixes: 8aa2f59260eb ("wifi: mt76: mt7921: introduce CSA support")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-03-19 14:09:49 +01:00
Lorenzo BianconiandFelix 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 BianconiandFelix 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
Shayne ChenandFelix Fietkau 70717b761a wifi: mt76: mt7996: rework set/get_tsf callabcks to support MLO
This is a preliminary patch in order to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Lorenzo BianconiandFelix 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
Shayne ChenandFelix Fietkau c788d5748d wifi: mt76: mt7996: rework mt7996_mcu_beacon_inband_discov to support MLO
Rework mt7996_mcu_beacon_inband_discov 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau 56529041b3 wifi: mt76: mt7996: rework mt7996_mcu_add_obss_spr to support MLO
Rework mt7996_mcu_add_obss_spr 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Lorenzo BianconiandFelix 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 BianconiandFelix 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 BianconiandFelix 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 BianconiandFelix 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
Shayne ChenandFelix Fietkau 3668d57795 wifi: mt76: mt7996: remove mt7996_mac_enable_rtscts()
It is controlled by FW, also, driver should not directly write WTBL to
prevent WTBL overwritten issues.

Signed-off-by: Shayne Chen <[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 BianconiandFelix 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
Shayne ChenandFelix Fietkau 9c6ec015af wifi: mt76: mt7996: rework mt7996_set_hw_key to support MLO
Modify mt7996_set_hw_key routine to work in a multi-link setup.
This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Lorenzo BianconiandFelix 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
Shayne ChenandFelix Fietkau 9b4de3ce7f wifi: mt76: mt7996: rework mt7996_sta_set_4addr and mt7996_sta_set_decap_offload to support MLO
Rework mt7996_sta_set_4addr and mt7996_sta_set_decap_offload routines in
order to properly support multi-link. This is a preliminary patch to enable
MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau 87c437fa8b wifi: mt76: mt7996: rework mt7996_rx_get_wcid to support MLO
The wcid idx and band idx in the TXS are sometimes mismatched since the
FW will select a transmission link according to a private algorithm.
That is, the wcid idx in the TXS would be the one registered by the
driver rather than the actual wcid idx used during transmission.
However, the band idx in the TXS is the band select for transmission.
Therefore, we should get the driver-registered wcid in order
to notify the driver the packet has been acked; otherwise,
the driver will be unable to match the transmitted packet and its TXS.
This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau 21aa0c2884 wifi: mt76: mt7996: Rely on wcid_to_sta in mt7996_mac_add_txs_skb()
This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau e0b422f2ac wifi: mt76: mt7996: rework mt7996_mac_write_txwi() for MLO support
Update mt7996_mac_write_txwi routine and all the called subroutines to
support MLO.
This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau 58e8b71782 wifi: mt76: mt7996: Add mt7996_mcu_teardown_mld_sta rouine
mt7996_mcu_teardown_mld_sta is used to remove MLO configuration from the
MCU. This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau 2a005953dc wifi: mt76: mt7996: Add mt7996_mcu_sta_mld_setup_tlv() and mt7996_mcu_sta_eht_mld_tlv()
mt7996_mcu_sta_mld_setup_tlv is needed to push MLO configuration to the
MCU. This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Shayne ChenandFelix Fietkau a3b651aeb5 wifi: mt76: mt7996: Update mt7996_mcu_add_rate_ctrl to MLO
Update mt7996_mcu_add_rate_ctrl routine and all the called subroutines
to support MLO.
This is a preliminary patch to enable MLO 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]>
Signed-off-by: Shayne Chen <[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-03-19 13:05:59 +01:00
Johannes BergandFelix Fietkau 7757e7c140 wifi: mac80211: call rate_control_rate_update() for link STA
In order to update the right link information, call the update
rate_control_rate_update() with the right link_sta, and then
pass that through to the driver's sta_rc_update() method. The
software rate control still doesn't support it, but that'll be
skipped by not having a rate control ref.

Since it now operates on a link sta, rename the driver method.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://patch.msgid.link/20241007144851.5851b6b5fd41.Ibdf50d96afa4b761dd9b9dfd54a1147e77a75329@changeid
Signed-off-by: Johannes Berg <[email protected]>
2025-03-19 13:05:44 +01:00