Commit Graph
37 Commits
Author SHA1 Message Date
Howard HsuandFelix Fietkau 6164391317 wifi: mt76: mt7996: support critical packet mode for MT7990 chipsets
For MT7990 chipsets, critical packet mode must be enabled. Without this,
some higher priority packets may be placed in the wrong AC queue.

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]>
2026-03-14 08:32:20 +00:00
Howard HsuandFelix Fietkau 74112c2956 wifi: mt76: mt7996: fix implicit beamforming support for mt7992
Fix the ibf_timeout field for mt7996, mt7992 and mt7990 chipsets. For
the mt7992, this value shall be set as 0xff, while the others shall be
set as 0x18.

Fixes: ad4c9a8a9803 ("wifi: mt76: mt7996: add implicit beamforming support for mt7992")
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]>
2025-11-06 11:34:56 +00:00
Howard HsuandFelix Fietkau a06461861f wifi: mt76: mt7996: fill User Priority in skb->priority for rx packets
Set UP in skb->priority to allow DSCP Learning at upper layers

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

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-12 12:48:23 +02:00
Howard HsuandFelix Fietkau b50c633f91 wifi: mt76: mt7996: support writing MAC TXD for AddBA Request
Support writing MAC TXD for the AddBA Req. Without this commit, the
start sequence number in AddBA Req will be unexpected value for MT7996
and MT7992. This can result in certain stations (e.g., AX200) dropping
packets, leading to ping failures and degraded connectivity. Ensuring
the correct MAC TXD and TXP helps maintain reliable packet transmission
and prevents interoperability issues with affected stations.

Signed-off-by: Howard Hsu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-09-09 18:07:40 +02:00
Howard HsuandFelix Fietkau 1865f5ea80 wifi: mt76: mt7996: fix beamformee SS field
Fix the beamformee SS field for the mt7996, mt7992 and mt7990 chipsets.
For the mt7992, this value shall be set to 0x4, while the others shall
be set to 0x3.

Fixes: 5b20557593d4 ("wifi: mt76: connac: adjust phy capabilities based on band constraints")
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]>
2025-05-21 14:44:30 +02:00
Howard HsuandFelix Fietkau a2838480f8 wifi: mt76: remove capability of partial bandwidth UL MU-MIMO
The firmware only supports full bandwidth UL MU-MIMO, so remove the
partial bandwidth capability from HE PHY CAP.

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]>
2025-05-21 14:44:30 +02:00
Howard HsuandFelix Fietkau 8e4f72b682 wifi: mt76: mt7996: add implicit beamforming support for mt7992
The configuration of mt7992 iBF has some differences to mt7996, rework
related code to make it work.
Also, most of our chipsets support iBF only on HT and VHT mode, except
mt7992 variant that has 5T on 5GHz band also supports iBF on HE and EHT
mode.

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2025-01-14 13:45:25 +01:00
Howard HsuandFelix Fietkau 46798905cf wifi: mt76: connac: adjust phy capabilities based on band constraints
Adjust HE and EHT phy capabilities based on the band constraints.
For 2g band, we shall not enable the capabilities above 40MHz.

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]>
2025-01-14 13:45:25 +01:00
Howard HsuandFelix Fietkau 32ee924831 wifi: mt76: mt7996: fix HE Phy capability
Set HE SU PPDU And HE MU PPDU With 4x HE-LTF And 0.8 us GI within HE PHY
Capabilities element as 1 since hardware can support.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
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]>
2025-01-14 13:45:25 +01:00
Howard HsuandFelix Fietkau 99d8ed164a wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU
This commit includes two changes. First, enable "EHT MU PPDU With 4x
EHT-LTF And 0.8us GI" in EHT Phy capabilities element since hardware
can support. Second, fix the value of "Maximum number of supported
EHT LTFs" in the same element, where the previous setting of 3 in
Bit 3-4 was incorrect.

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]>
2025-01-14 13:45:25 +01: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
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
Howard HsuandFelix Fietkau f70cb4f050 wifi: mt76: connac: enable critical packet mode support for mt7992
For mt7992 chipsets, critical packet mode should be properly configured
to let the HW SDO module correctly fill the AC queue in TX descriptors of
some higher priority packets such as ARP and ICMP.
Without this patch, HW queues may hang when running MU traffic.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 12:58:27 +02:00
Howard HsuandFelix Fietkau 424e9df466 wifi: mt76: mt7996: fix potential memory leakage when reading chip temperature
Without this commit, reading chip temperature will cause memory leakage.

Fixes: 6879b2e94172 ("wifi: mt76: mt7996: add thermal sensor device support")
Reported-by: Ryder Lee <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 12:58:27 +02:00
Howard HsuandFelix Fietkau 0b7e645db9 wifi: mt76: connac: enable HW CSO module for mt7996
For mt7996 chipsets, the HW CSO module can help to identify TCP traffic,
which assists the firmware in adjusting algorithms to improve overall
performance.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-04-03 12:58:27 +02:00
Howard HsuandFelix Fietkau 4f681a8fbc wifi: mt76: mt7915: fix HE PHY capabilities IE for station mode
Set correct beamformer capabilities for station vif in HE PHY
capabilities IE.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-03-15 17:07:47 +01:00
Howard HsuandFelix Fietkau 68dad7dacd wifi: mt76: mt7996: fix HE beamformer phy cap for station vif
Set correct beamformer capabilities for station vif in HE PHY
capability IE.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2024-02-03 15:04:42 +01:00
Howard HsuandFelix Fietkau 0aead5de68 wifi: mt76: connac: set fixed_bw bit in TX descriptor for fixed rate frames
Always set the fixed_bw bitfield for fixed rate frames to keep it being
sent with specific bandwidth. Without this change, the bw of fixed rate
frames will still be decided by hardware.

Reported-by: Chank Chen <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-11-17 14:13:03 +01:00
Howard HsuandFelix Fietkau 955540a4df wifi: mt76: mt7996: add thermal sensor device support
This patch adds support for thermal sensor device, including the
following features:
- Support to read current chip temperature.
- Support to set/get the trigger/restore temperature for thermal service.
- Support to read current chip tx cycle.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-11-17 14:13:03 +01:00
Howard HsuandFelix Fietkau 9852093062 wifi: mt76: connac: add thermal protection support for mt7996
Implement thermal protection commands and support Linux cooling device
control for mt7996 chipsets.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-11-17 14:12:32 +01:00
Howard HsuandFelix Fietkau cec7720c93 wifi: mt76: mt7996: add TX statistics for EHT mode in debugfs
Add EHT statistics of beamforming feedback and BW320 in debugfs tx_stats
command.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-11-17 14:12:32 +01:00
Howard HsuandFelix Fietkau fea1e10c77 wifi: mt76: mt7996: support more options for mt7996_set_bitrate_mask()
Add support to configure parameters at runtime, such as mcs, gi, and
he_ltf. Note that EHT mode does not support this feature yet.

Co-developed-by: MeiChia Chiu <[email protected]>
Signed-off-by: MeiChia Chiu <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-16 14:12:29 +02:00
Howard HsuandFelix Fietkau e512241bb5 wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap
According to P802.11be_D3.2 Table 9-404m, the minimum value of
Beamformee SS field shall be 3. Fix the values to follow the spec.

Fixes: 348533eb968d ("wifi: mt76: mt7996: add EHT capability init")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-16 14:12:29 +02:00
Howard HsuandFelix Fietkau 2cfe2fb0bb wifi: mt76: mt7996: fix beamform mcu cmd configuration
The bf_num field represents how many bands can support beamform, so set
the value to 3, and bf_bitmap represents the bitmap of bf_num.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-16 14:12:29 +02:00
Howard HsuandFelix Fietkau ece67c98dc wifi: mt76: mt7996: increase tx token size
Align tx token size to proprietary driver, which can improve peak
throughput under MU performance tests.

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Howard HsuandFelix Fietkau a69c34a604 wifi: mt76: mt7915: rework init flow in mt7915_thermal_init()
If kernel do not enable CONFIG_HWMON, it may cause thermal
initialization to be done with temperature value 0 and then can not
transmit. This commit fixes it by setting trigger/restore temperature
before checking CONFIG_HWMON.

Fixes: 7d12b38ab6f6 ("wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after init_work")
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-02-28 11:19:52 +01:00
Howard HsuandFelix Fietkau c6f24b83eb wifi: mt76: mt7915: add error message in mt7915_thermal_set_cur_throttle_state()
Add dev_err so that it is easier to see invalid setting while looking at
dmesg.

Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-01-23 10:32:48 +01:00
Howard HsuandFelix Fietkau 87cb74fe42 wifi: mt76: mt7915: rework mt7915_thermal_temp_store()
Call mt7915_mcu_set_thermal_protect() through
mt7915_thermal_temp_store() to update firmware trigger/restore temp
directly.

Fixes: 02ee68b95d81 ("mt76: mt7915: add control knobs for thermal throttling")
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-01-23 10:32:48 +01:00
Howard HsuandFelix Fietkau 8e5c21fe7c wifi: mt76: mt7915: rework mt7915_mcu_set_thermal_throttling
This patch includes 2 changes:
1. Firmware expects to disable thermal protect first before
reconfiguring.
2. Separate setting thermal_protect and setting thermal_tx_duty into
different functions. These two firmware commands do not need to send
together.

Fixes: 34b877d972be ("mt76: mt7915: add thermal cooling device support")
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-01-23 10:32:48 +01:00
Howard HsuandFelix Fietkau 15b9dd6b1b wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after init_work
Enable thermal management by default shall not be executed during mcu
init. This causes thermal configuration being reset to the firmware
default settings.

Fixes: 0063b86c9120 ("mt76: mt7915e: Enable thermal management by default")
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-01-23 10:32:48 +01:00
Howard HsuandFelix Fietkau 1e9060420c wifi: mt76: mt7915: fix incorrect tx path number configuration
For a variant of mt7916, it supports up to 3 tx/rx paths but only 2
spatial streams. This implies that it has one more path to support
beamform. The correct tx/rx path number shall be configured to make sure
beamform works properly.

Fixes: bdaddc92f6b0 ("wifi: mt76: mt7915: deal with special variant of mt7916")
Reviewed-by: Shayne Chen <[email protected]>
Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-11-11 11:38:25 +01:00
Howard HsuandFelix Fietkau e06376af21 wifi: mt76: mt7915: do not check state before configuring implicit beamform
Do not need to check running state before configuring implicit Tx
beamform. It is okay to configure implicit Tx beamform in run time.
Noted that the existing connected stations will be applied for new
configuration only if they reconnected to the interface.

Fixes: 6377b7f330 ("mt76: mt7915: add implicit Tx beamforming support")

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Howard HsuandFelix Fietkau 2ac22300c7 wifi: mt76: mt7915: fix mcs value in ht mode
Fix the error that mcs will be reduced to a range of 0 to 7 in ht mode.

Fixes: 70fd1333cd32 ("mt76: mt7915: rework .set_bitrate_mask() to support more options")

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00