Commit Graph
4057 Commits
Author SHA1 Message Date
Felix Fietkau 11c851e743 wifi: mt76: mt7915: implement calibration data merge support
This allows efuse to override flash/default EEPROM data.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-23 17:53:54 +02:00
Felix Fietkau 1a6ea9d3f8 wifi: mt76: mt7915: load efuse data unconditionally
This allows looking at the data through the 'otp' debugfs file.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-23 16:33:57 +02:00
Felix Fietkau e6afe9218a wifi: mt76: mt7915: fix unused variable error
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-23 00:48:02 +02:00
Felix Fietkau b76f16ea65 wifi: mt76: mt7915: improve hardware restart reliability
- use reconfig_complete to restart mac_work / queues
- reset full wtbl after firmware init
- clear wcid and vif mask to avoid leak

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 23:00:16 +02:00
Felix Fietkau 1f4ac8faa5 wifi: mt76: connac: move mt7615_mcu_del_wtbl_all to connac
Preparation for reusing it in mt7915

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 22:43:43 +02:00
Felix Fietkau 65bbd4c394 firmware: update MT7986 firmware to version 20240507160203
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 20:52:11 +02:00
Felix Fietkau aea16bfe8d firmware: update MT7981 firmware to version 20240507201102
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 20:51:36 +02:00
Felix Fietkau 084eaaf479 wifi: mt76: mt7915: fix sta poll list corruption on hw restart
When ieee80211_restart_hw is called, all interfaces and stations are
recreated. This can lead to corruption in the sta poll list, since
existing entries were not removed before their private data is reset.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-22 19:31:39 +02:00
Peter ChiuandFelix Fietkau 4e8167b941 wifi: mt76: connac: fix checksum offload fields of connac3 RXD
Fix incorrect RXD offset and bitfield related to RX checksum offload.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Fixes: 4e9011fcdfc4 ("wifi: mt76: connac: move connac3 definitions in mt76_connac3_mac.h")
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]>
2024-08-21 17:16:19 +02:00
Felix Fietkau dbc9b0df7c linux-firmware: update firmware for MT7996
This commit updates firmware files to 20240809 for MT7996 WiFi devices.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-21 17:10:59 +02:00
Felix Fietkau a5e630ef45 wifi: mt76: mt7916: fix regression in .sta_state migration
- initialize and use per-sta wcid entry instead of vif wcid
- set wcid flags for 4addr/offload
- fix 'newly' argument for vif sta entry update

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-21 16:51:03 +02:00
Felix Fietkau 3cd1c17402 wifi: mt76: mt7915: hold dev->mt76.mutex while disabling tx worker
Prevent racing against other functions disabling the same worker

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:21:05 +02:00
Felix Fietkau caed4843c5 wifi: mt76: fix station muar index
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:05:30 +02:00
Felix Fietkau d547c25cab wifi: mt76: mt7915: fix last argument to mt7915_mcu_add_sta
Purely cosmetic

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:05:30 +02:00
Felix Fietkau 5c9fbdd643 wifi: mt7915: fix wcid allocation leak
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-19 20:05:11 +02:00
Felix Fietkau 0ac3041a9a wifi: mt76: fix off-channel wcid pending queue handling
- migrate offchannel to on-channel on switch
- fix scheduling during offchannel

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-18 09:54:11 +02:00
Michael-CY LeeandFelix Fietkau 437ec1b9e2 wifi: mt76: mt7996: set IEEE80211_KEY_FLAG_GENERATE_MMIE for other ciphers
When beacon protection is enabled, FW checks MMIE tag & length in the
beacon for every cipher mode. To pass the check, driver needs to set the
key flag IEEE80211_KEY_GENERATE_MMIE to let mac80211 generate and
initialize MMIE.

Signed-off-by: Michael-CY Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Benjamin LinandFelix Fietkau bb6a5dbbb7 wifi: mt76: connac: add IEEE 802.11 fragmentation support for mt7996
Add fragment index into TXD.DW2 to support IEEE 802.11 fragmentation.

Signed-off-by: Benjamin Lin <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Rex LuandFelix Fietkau c4e34c8bb9 wifi: mt76: mt7996: fix handling mbss enable/disable
When mbss was previously enabled, the TLV needs to be included when
disabling it again, in order to clear the firmware state.

Fixes: a7908d5b61e5 ("wifi: mt76: mt7996: fix non-main BSS no beacon issue for MBSS scenario")
Signed-off-by: Rex Lu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Howard HsuandFelix Fietkau 4a90f92731 wifi: mt76: mt7996: set correct value in beamforming mcu command for mt7992
Configure correct bf number and bitmap in beamforming mcu command for
mt7992 chipsets, which only support dual-band.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Howard HsuandFelix Fietkau 5cf02b0a26 wifi: mt76: mt7996: fix EHT beamforming capability check
If a VIF acts as a beamformer, it should check peer's beamformee
capability, and vice versa.

Fixes: ba01944adee9 ("wifi: mt76: mt7996: add EHT beamforming support")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Howard HsuandFelix Fietkau c2c6940e60 wifi: mt76: mt7996: set correct beamformee SS capability
According to IEEE P802.11be/D6.0 Table 9-417n, beamformee SS field stands
for the maximum number of spatial streams that the STA can receive in an
EHT sounding NDP minus 1, and the minimum value of this field is 3.

This value indicates the decoding capability of a beamformee, which is
independent of current antenna settings. Correct the value for mt7996
and mt7992 chipsets based on their HW capability.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Howard HsuandFelix Fietkau bf2eeec731 wifi: mt76: mt7996: fix HE and EHT beamforming capabilities
Fix HE and EHT beamforming capabilities for different bands and
interface types.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Fixes: 348533eb968d ("wifi: mt76: mt7996: add EHT capability init")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-16 19:21:32 +02:00
Peter ChiuandFelix Fietkau 8e2f906cb1 wifi: mt76: mt7996: advertize beacon_int_min_gcd
Advertize beacon_int_min_gcd as 100 to allow setting different beacon
intervals on different interfaces.

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]>
2024-08-16 19:21:32 +02:00
Peter ChiuandFelix Fietkau a5aa259fb1 wifi: mt76: mt7996: fix wmm set of station interface to 3
According to connac3 HW design, the WMM index of AP and STA interface
should be 0 and 3, respectively.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
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]>
2024-08-16 19:21:32 +02:00
Peter ChiuandFelix Fietkau b980637b11 wifi: mt76: mt7996: fix traffic delay when switching back to working channel
During scanning, UNI_CHANNEL_RX_PATH tag is necessary for the firmware to
properly stop and resume MAC TX queue. Without this tag, HW needs more time
to resume traffic when switching back to working channel.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
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]>
2024-08-16 19:21:32 +02:00
Peter ChiuandFelix Fietkau 37955a4d08 wifi: mt76: mt7996: use hweight16 to get correct tx antenna
The chainmask is u16 so using hweight8 cannot get correct tx_ant.
Without this patch, the tx_ant of band 2 would be -1 and lead to the
following issue:
BUG: KASAN: stack-out-of-bounds in mt7996_mcu_add_sta+0x12e0/0x16e0 [mt7996e]

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
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]>
2024-08-16 19:21:32 +02:00
Felix Fietkau 362fec004c wifi: mt76: mt7915: reset the device after MCU timeout
On MT7915, MCU hangs do not trigger watchdog interrupts, so they can only
be detected through MCU message timeouts. Ensure that the hardware gets
restarted when that happens in order to prevent a permanent stuck state.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-13 20:48:53 +02:00
Felix Fietkau a1a65d8608 wifi: mt76: mt7915: retry mcu messages
In some cases MCU messages can get lost. Instead of failing completely,
attempt to recover by re-sending them.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-13 20:22:43 +02:00
Felix Fietkau 863b3a5f52 wifi: mt76: mt7915: set MT76_MCU_RESET early in mt7915_mac_full_reset
This avoids running into unnecessary timeouts waiting for MCU responses

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-13 19:53:35 +02:00
Felix Fietkau 5af2f7c8e8 wifi: mt76: mt7915: use mac80211 .sta_state op
Allows adding stations before assoc, though they are not passed to the
firmware yet at that point.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:09:09 +02:00
Felix Fietkau ea8c3eac12 wifi: mt76: change .sta_assoc callback to .sta_event
Also report auth/disassoc events, in order to give the driver more control over
handling the station state.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:09:03 +02:00
Felix Fietkau 1305484d04 wifi: mt76: connac: add support for passing connection state directly
Preparation for improvements to sta handling. No functional changes.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:54 +02:00
Felix Fietkau e0a409af55 wifi: mt76: mt7915: allocate vif wcid in the same range as stations
Reduces the amount of unnecessary WTBL bank switching, while still reserving
WTBL entries for vifs.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:34 +02:00
Felix Fietkau 4eea0786d8 wifi: mt76: mt7915: disable tx worker during tx BA session enable/disable
Avoids firmware race condition.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:34 +02:00
Felix Fietkau 891031ee05 wifi: mt76: add separate tx scheduling queue for off-channel tx
Ensure that packets are not sent out to the wrong channel

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:34 +02:00
Felix Fietkau b80c997b3f wifi: mt76: partially move channel change code to core
This allows the core code to change the channel. Code deduplication and
preparation for adding scanning code to the core.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:33 +02:00
Felix Fietkau 6ccafa50c6 firmware: update firmware for MT7915 to 20240429200502
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 21:08:33 +02:00
Howard HsuandFelix Fietkau b4da028f99 wifi: mt76: mt7915: fix rx filter setting for bfee functionality
Fix rx filter setting to prevent dropping NDPA frames. Without this
change, bfee functionality may behave abnormally.

Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 18:18:56 +02:00
Benjamin LinandFelix Fietkau c4c66f6b11 wifi: mt76: mt7915: add dummy HW offload of IEEE 802.11 fragmentation
Currently, CONNAC2 series do not support encryption for fragmented Tx frames.
Therefore, add dummy function mt7915_set_frag_threshold() to prevent SW
IEEE 802.11 fragmentation.

Signed-off-by: Benjamin Lin <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 18:17:34 +02:00
Benjamin LinandFelix Fietkau d5286f465f wifi: mt76: connac: add support for IEEE 802.11 fragmentation
Add fragmentation index into TXD.DW2 to support IEEE 802.11 fragmentation.

Signed-off-by: Benjamin Lin <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 18:15:27 +02:00
Felix Fietkau c13032ba47 wifi: mt76: mt7915: always query station rx rate from firmware
When offloading is enabled, the software rx path may not have the latest
rate information.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-12 17:56:37 +02:00
Felix Fietkau fdba7f4088 wifi: mt76: fix mt76_get_rate
Do not assume that the first phy has 2 GHz support.
Check sband->band instead of accessing dev->phy.sband_2g.

Signed-off-by: Felix Fietkau <[email protected]>
2024-08-09 10:32:37 +02:00
Felix Fietkau 6585a4353a wifi: mt76: mt7921: fix crash on ipv6 addr notification during vif bringup
mvif->phy is NULL when the interface is not properly initialized yet

Signed-off-by: Felix Fietkau <[email protected]>
2024-07-17 17:26:53 +02:00
Felix Fietkau e25fb9a010 wifi: mt76: mt7921: add missing bss_conf vif init
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-16 14:33:33 +02:00
Gustavo A. R. SilvaandFelix Fietkau b6fd8fe5d2 wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings
Transform zero-length arrays `rate`, `adm_stat` and `msdu_cnt` into
proper flexible-array members in anonymous union in `struct
mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY()
helper; and fix multiple -Warray-bounds warnings:

drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:544:61: warning: array subscript <unknown> is outside array bounds of 'struct <anonymous>[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:551:58: warning: array subscript <unknown> is outside array bounds of 'struct <anonymous>[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:553:58: warning: array subscript <unknown> is outside array bounds of 'struct <anonymous>[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:530:61: warning: array subscript <unknown> is outside array bounds of 'struct <anonymous>[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:538:66: warning: array subscript <unknown> is outside array bounds of 'struct <anonymous>[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:540:66: warning: array subscript <unknown> is outside array bounds of 'struct <anonymous>[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:520:57: warning: array subscript <unknown> is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript <unknown> is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript <unknown> is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript <unknown> is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=]
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:526:76: warning: array subscript <unknown> is outside array bounds of 'struct all_sta_trx_rate[0]' [-Warray-bounds=]

This results in no differences in binary output, helps with the ongoing
efforts to globally enable -Warray-bounds.

Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/ZXiU9ayVCslt3qiI@work
2024-07-16 14:31:31 +02:00
Michael LoandFelix Fietkau 3a367258d9 wifi: mt76: mt792x: fix scheduler interference in drv own process
Add some time to wait for LP engine to complete its operation
before polling pmctrl register.

Signed-off-by: Michael Lo <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Tested-by: David Ruth <[email protected]>
Acked-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-16 14:30:13 +02:00
Sean WangandFelix Fietkau e0b4763428 wifi: mt76: mt7925: enabling MLO when the firmware supports it
Register MLD capability for the firmware supporting MLO.

Co-developed-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/49c796b101e792c84bc2c0d74753022b75fd3355.1720248331.git.sean.wang@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-16 14:30:13 +02:00
Sean WangandFelix Fietkau 94fe680187 wifi: mt76: mt7925: remove the unused mt7925_mcu_set_chan_info
remove the unused function mt7925_mcu_set_chan_info

Co-developed-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/0aa0abe7fc661380ae812c6bc879a7705de401b2.1720248331.git.sean.wang@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-16 14:30:13 +02:00
Sean WangandFelix Fietkau 17f5ef8058 wifi: mt76: mt7925: update mt7925_mac_link_bss_add for MLO
Update band_idx in per-link BSS to be auto for the MLO-enabled firmware
and the MLO-enabled firmware only supports omac index in 0.

The change remains compatible with the non-MLO mode and the older firmware.

Co-developed-by: Ming Yen Hsieh <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/37fcf3ea7b4883840d61f97231277b297e1b15a3.1720248331.git.sean.wang@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
2024-07-16 14:30:13 +02:00