Commit Graph
4571 Commits
Author SHA1 Message Date
Zhi-Jun YouandFelix Fietkau 0d6eaa4174 wifi: mt76: mt7915: fix mt7981 pre-calibration
In vendor driver, size of group cal and dpd cal for mt7981 includes 6G
although the chip doesn't support it.

mt76 doesn't take this into account which results in reading from the
incorrect offset.

For devices with precal, this would lead to lower bitrate.

Fix this by aligning groupcal size with vendor driver and switch to
freq_list_v2 in mt7915_dpd_freq_idx in order to get the correct offset.

Below are iwinfo of the test device with two clients connected
(iPhone 16, Intel AX210).
Before :
	Mode: Master  Channel: 36 (5.180 GHz)  HT Mode: HE80
	Center Channel 1: 42 2: unknown
	Tx-Power: 23 dBm  Link Quality: 43/70
	Signal: -67 dBm  Noise: -92 dBm
	Bit Rate: 612.4 MBit/s
	Encryption: WPA3 SAE (CCMP)
	Type: nl80211  HW Mode(s): 802.11ac/ax/n
	Hardware: embedded [MediaTek MT7981]

After:
	Mode: Master  Channel: 36 (5.180 GHz)  HT Mode: HE80
	Center Channel 1: 42 2: unknown
	Tx-Power: 23 dBm  Link Quality: 43/70
	Signal: -67 dBm  Noise: -92 dBm
	Bit Rate: 900.6 MBit/s
	Encryption: WPA3 SAE (CCMP)
	Type: nl80211  HW Mode(s): 802.11ac/ax/n
	Hardware: embedded [MediaTek MT7981]

Tested-on: mt7981 20240823

Fixes: 19a954edec63 ("wifi: mt76: mt7915: add mt7986, mt7916 and mt7981 pre-calibration")
Signed-off-by: Zhi-Jun You <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 15:08:35 +02:00
Lorenzo BianconiandFelix 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
Felix Fietkau 76401f5e2e mt76: update RRO patches to the latest version
Fix endian issues

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 15:06:06 +02:00
Felix Fietkau 91dcccebfe firmware: update mt7996/mt7992 firmware to 20250905
Upstream description:
"Update FW to 20250905 to fix MLO T.P issue scan or channel switch."

Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 10:40:24 +02:00
Felix Fietkau 03b0c87163 wifi: mt76: mt7996: add missing NULL pointer check
Fixes: d1a2900a39 ("wifi: mt76: mt7996: Set proper link destination address in mt7996_tx()")
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 09:56:12 +02:00
Ming Yen HsiehandFelix Fietkau 719cda7c9f wifi: mt76: mt7925: prevent NULL pointer dereference in mt7925_tx_check_aggr()
Move the NULL check for 'sta' before dereferencing it to prevent a
possible crash.

Fixes: 44eb173bdd4f ("wifi: mt76: mt7925: add link handling in mt7925_txwi_free")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 07:19:41 +02:00
Ming Yen HsiehandFelix Fietkau d48b221e39 wifi: mt76: mt7925: prevent NULL vif dereference in mt7925_mac_write_txwi
Check for a NULL `vif` before accessing `ieee80211_vif_is_mld(vif)` to
avoid a potential kernel panic in scenarios where `vif` might not be
initialized.

Fixes: ebb1406813c6 ("wifi: mt76: mt7925: add link handling to txwi")
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 07:19:41 +02:00
Felix Fietkau f271ce48d7 mt76: mt7996: fix unsigned comparison
Fixes detecing error condition from get_own_mld_idx

Fixes: 110ecc3311 ("wifi: mt76: mt7996: Fix mt7996_mcu_bss_mld_tlv routine")
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 06:36:19 +02:00
Rex LuandFelix Fietkau 6c902ccba8 wifi: mt76: mt7996: Add SW path for HW-RRO v3.1
Introduce HW-RRO v3.1 support to be reused when Wireless Ethernet
Dispatcher (WED) is not available. HW-RRO v3.1 is supported by
MT7992 chipset.

Signed-off-by: Rex Lu <[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-09-04 19:09:11 +02:00
Lorenzo BianconiandFelix 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
Rex LuandFelix Fietkau d82330a9d0 wifi: mt76: mt7996: Decouple RRO logic from WED support
Decouple RRO logic from WED support in MT7996 driver in order to reuse
it when WED module is not available.

Signed-off-by: Rex Lu <[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-09-04 19:09:11 +02:00
Lorenzo BianconiandFelix 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
Rex LuandFelix Fietkau 13eb05fa4a wifi: mt76: mt7996: Introduce RRO MSDU callbacks
Introduce rx_rro_ind_process and rx_rro_add_msdu_page callbacks and the
related logic in the MT7996 driver. This is a preliminary patch to
decouple RRO logic from WED support and reuse RRO when WED module is not
available.

Signed-off-by: Rex Lu <[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-09-04 19:09:11 +02:00
Rex LuandFelix Fietkau 6b518355fe wifi: mt76: mt7996: Enable WED for MT7992 chipset
Introduce WED offload support for MT7992 chipset in MT7996 driver.

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: Rex Lu <[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-09-04 19:09:11 +02:00
Lorenzo BianconiandFelix 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 BianconiandFelix 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
Rex LuandFelix Fietkau 8134055d34 wifi: mt76: mt7996: Introduce the capability to reset MT7992 WED device
This is a preliminary patch to enable WED support for MT7992 Kite
chipset supported by MT7996 driver.

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: Rex Lu <[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-09-04 19:09:11 +02:00
Rex LuandFelix Fietkau fca511f401 wifi: mt76: mt7996: Enable HW RRO for MT7992 chipset
This is a preliminary patch to enable WED support for MT7992 Kite
chipset supported by MT7996 driver.

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: Rex Lu <[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-09-04 19:09:11 +02:00
Rex LuandFelix Fietkau 1df7908392 wifi: mt76: mt7996: Initial DMA configuration for MT7992 WED support
Manage differences in DMA and RX queues configuration for MT7992 and
MT7996.
This is a preliminary patch to enable WED support for MT7992 Kite
chipset supported by MT7996 driver.

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: Rex Lu <[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-09-04 19:09:11 +02:00
Lorenzo BianconiandFelix 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
Rex LuandFelix Fietkau d540538299 wifi: mt76: Differentiate between RRO data and RRO MSDU queues
This is a preliminary patch to enable WED support for MT7992 Kite
chipset supported by MT7996 driver.

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: Rex Lu <[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-09-04 19:09:11 +02:00
Lorenzo BianconiandFelix 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 BianconiandFelix 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 BianconiandFelix 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
Breno LeitaoandFelix Fietkau ef2468830f wifi: mt76: un-embedd netdev from mt76_dev
Embedding net_device into structures prohibits the usage of flexible
arrays in the net_device structure. For more details, see the discussion
at [1].

Un-embed the net_devices from struct mt76_dev by converting them
into pointers, and allocating them dynamically. Use the leverage
alloc_netdev_dummy() to allocate the net_device object at
mt76_dma_init().

The free of the device occurs at mt76_dma_cleanup().

Link: https://lore.kernel.org/all/[email protected]/ [1]
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Breno Leitao <[email protected]>
Acked-by: Kalle Valo <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
2025-09-04 19:05:35 +02:00
Rory LittleandFelix Fietkau 5f3ea4562f wifi: mt76: mt7921: Place upper limit on station AID
Any station configured with an AID over 20 causes a firmware crash.
This situation occurred in our testing using an AP interface on 7922
hardware, with a modified hostapd, sourced from Mediatek's OpenWRT
feeds.

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

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

Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support")
Signed-off-by: Rory Little <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-04 15:02:50 +02:00
Benjamin LinandFelix Fietkau a1c319500a wifi: mt76: mt7996: Temporarily disable EPCS
EPCS is not yet ready, so do not claim to support it.

Signed-off-by: Benjamin Lin <[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-09-04 15:01:06 +02:00
Shayne ChenandFelix Fietkau 16090cb27d wifi: mt76: mt7996: Implement MLD address translation for EAPOL
Do the MLD to link address translation for EAPOL frames in driver.

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-09-04 15:01:06 +02:00
Lorenzo BianconiandFelix 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
Shayne ChenandFelix Fietkau 304226bc45 wifi: mt76: mt7996: Fix mt7996_reverse_frag0_hdr_trans for MLO
Update mt7996_reverse_frag0_hdr_trans routine to support MLO.

Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[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-09-04 15:01:06 +02:00
Felix Fietkau d30faac3b6 firmware: update mt7996 and mt7992 firmware to 20250606
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-02 20:09:02 +02:00
Lorenzo BianconiandFelix 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
Quan ZhouandFelix Fietkau 51a1c0a086 wifi: mt76: mt7921: Add 160MHz beamformee capability for mt7922 device
Enable 160MHz beamformee support on mt7922 by updating HE capability
element configuration. Previously, only 160MHz channel width was set,
but beamformee for 160MHz was not properly advertised. This patch
adds BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 capability to allow devices
to utilize 160MHz BW for beamforming.

Tested by connecting to 160MHz-bandwidth beamforming AP and verified
HE capability.

Signed-off-by: Quan Zhou <[email protected]>
Link: https://patch.msgid.link/ae637afaffed387018fdc43709470ef65898ff0b.1756383627.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-01 16:48:07 +02:00
Jack KaoandFelix Fietkau 3400b1ba33 wifi: mt76: mt7925: add pci restore for hibernate
Due to hibernation causing a power off and power on,
this modification adds mt7925_pci_restore callback function for kernel.
When hibernation resumes, it calls mt7925_pci_restore to reset the device,
allowing it to return to the state it was in before the power off.

Signed-off-by: Jack Kao <[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-09-01 16:48:07 +02:00
Lorenzo BianconiandFelix 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 BianconiandFelix 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 BianconiandFelix 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 BianconiandFelix 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
Shayne ChenandFelix Fietkau de1df8b888 wifi: mt76: mt7996: Export MLO AP capabilities to mac80211
Report MT7996 MLO AP capabilities to mac80211 stack.

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-08-27 11:15:47 +02:00
Lorenzo BianconiandFelix 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 BianconiandFelix 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
Ming Yen HsiehandFelix Fietkau a35af27787 wifi: mt76: mt7925: skip EHT MLD TLV on non-MLD and pass conn_state for sta_cmd
Return early in mt7925_mcu_sta_eht_mld_tlv() for non-MLD vifs to avoid bogus
MLD TLVs, and pass the proper connection state to sta_basic TLV.

Cc: [email protected]
Fixes: cb1353ef3473 ("wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd")
Reported-by: Tal Inbar <[email protected]>
Tested-by: Tal Inbar <[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-08-27 11:12:50 +02:00
Ming Yen HsiehandFelix Fietkau 3ed2c4030d wifi: mt76: mt7925u: use connac3 tx aggr check in tx complete
MT7925 is a connac3 device; using the connac2 helper mis-parses
TXWI and breaks AMPDU/BA accounting. Use the connac3-specific
helper mt7925_tx_check_aggr() instead,

Cc: [email protected]
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Reported-by: Nick Morrow <[email protected]>
Tested-by: Nick Morrow <[email protected]>
Tested-on: Netgear A9000 USB WiFi adapter
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-27 11:12:50 +02:00
Felix Fietkau 415b5a6887 wifi: mt76: fix list corruption
Never leave scheduled wcid entries on the temporary on-stack list

Fixes: 0b3be9d1d34e ("wifi: mt76: add separate tx scheduling queue for off-channel tx")
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-27 11:12:50 +02:00
Felix Fietkau ee538efba5 wifi: mt76: free pending offchannel tx frames on wcid cleanup
Avoid leaking them or keeping the wcid on the tx list

Fixes: 0b3be9d1d34e ("wifi: mt76: add separate tx scheduling queue for off-channel tx")
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-27 10:47:58 +02:00
Felix Fietkau 4cd64ad128 wifi: mt76: mt7915: fix list corruption after hardware restart
Since stations are recreated from scratch, all lists that wcids are added
to must be cleared before calling ieee80211_restart_hw.
Set wcid->sta = 0 for each wcid entry in order to ensure that they are
not added again before they are ready.

Signed-off-by: Felix Fietkau <[email protected]>
2025-08-25 16:14:39 +02:00
Felix Fietkau fb7e0501b8 wifi: mt76: mt7996: add missing check for rx wcid entries
Non-station wcid entries must not be passed to the rx functions.
In case of the global wcid entry, it could even lead to corruption in the wcid
array due to pointer being casted to struct mt7996_sta_link using container_of.

Fixes: 7464b12b7d92 ("wifi: mt76: mt7996: rework mt7996_rx_get_wcid to support MLO")
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-25 16:14:39 +02:00
Felix Fietkau fb22489fd7 wifi: mt76: do not add non-sta wcid entries to the poll list
Polling and airtime reporting is valid for station entries only

Signed-off-by: Felix Fietkau <[email protected]>
2025-08-25 16:14:30 +02:00
Felix Fietkau d729307b5e mt76: mt7996: add missing null pointer check
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-15 11:10:53 +02:00
Felix Fietkau 5f61f34087 wifi: mt76: mt7996: fix crash on some tx status reports
When a wcid can't be found, link_sta can be stale from a previous batch.
The code currently assumes that if link_sta is set, wcid is also non-zero.
Fix wcid NULL pointer dereference by resetting link_sta when a wcid entry
can't be found.

Fixes: 62da647a2b20 ("wifi: mt76: mt7996: Add MLO support to mt7996_tx_check_aggr()")
Signed-off-by: Felix Fietkau <[email protected]>
2025-08-14 18:41:00 +02:00