535 Commits
Author SHA1 Message Date
Shayne ChenandFelix Fietkau b3f739a64e wifi: mt76: mt7996: add eht rx rate support
Add support to report eht rx rate.
Note that extended fields for eht in mt76_rx_status will make the struct
size exceed the cb size, so make nss and band share the same u8.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 13:10:51 +02:00
Felix Fietkau bbbac7deee wifi: mt76: rename mt76_packet_id_init/flush to mt76_wcid_init/cleanup
Also un-inline the functions. Will be used for further wcid init/cleanup

Signed-off-by: Felix Fietkau <[email protected]>
2023-09-11 13:10:34 +02:00
Lorenzo BianconiandFelix Fietkau cf752af84c wifi: mt76: mt76_connac3: move lmac queue enumeration in mt76_connac3_mac.h
This is a preliminary patch to introduce mt7925 chip support

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-07-26 13:15:57 +02:00
Lorenzo BianconiandFelix Fietkau 29cfabbb4b wifi: mt76: connac: add connac3 mac library
Introduce connac3_mac in mt76_connac library to reuse mac code shared
between WiFi7 chipsets. So far connac3 library contains just radiotap
parsing code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 19:24:40 +02:00
Lorenzo BianconiandFelix Fietkau 0dc4326991 wifi: mt76: connac: move connac3 definitions in mt76_connac3_mac.h
Connac3 mac definitions are shared between WiFi7 chipsets so move them in
mt76_connac3_mac.h

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 19:24:40 +02:00
Lorenzo BianconiandFelix Fietkau 39a70710dd wifi: mt76: move rate info in mt76_vif
This is a preliminary patch to introduce mt76_connac3 mac library used
by WiFi7 chipsets (e.g. mt7996).

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 19:24:40 +02:00
Lorenzo BianconiandFelix Fietkau f5c5eece50 wifi: mt76: move ampdu_state in mt76_wcid
ampdu_state field is used by most of the drivers, so move it in
mt76_wcid structure.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 19:24:03 +02:00
Lorenzo BianconiandFelix Fietkau b87e4dad1e wifi: mt76: mt7996: rely on shared poll_list field
Rely on poll_list field in mt76_wcid  structure and get rid of
private copy.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 19:24:03 +02:00
Lorenzo BianconiandFelix Fietkau 6da2e0e4ef wifi: mt76: mt7996: rely on shared sta_poll_list and sta_poll_lock
Rely on sta_poll_list and sta_poll_lock fields in mt76_dev structure
and get rid of private copies.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 19:24:03 +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
MeiChia ChiuandFelix Fietkau b511a437ac wifi: mt76: mt7996: add muru support
Add sta_rec_muru() fw command to support MU-MIMO and OFDMA features.

Signed-off-by: MeiChia Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
StanleyYP WangandFelix Fietkau 2c163f1812 wifi: mt76: mt7996: fix WA event ring size
Fix rx ring size of WA event to get rid of event loss and queue overflow
problems.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
StanleyYP WangandFelix Fietkau 080ca19cc6 wifi: mt76: mt7996: use correct phy for background radar event
If driver directly uses the band_idx reported from the radar event to
access mt76_phy array, it will get the wrong phy for background radar.
Fix this by adjusting the statement.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Peter ChiuandFelix Fietkau e1bb4ef7b2 wifi: mt76: connac: add support to set ifs time by mcu command
There's a race between driver and fw on some tx/rx control registers
when setting ifs, which will cause accidental hw queue pause problems.
Avoid this by setting ifs time with bss_info mcu command.

Reviewed-by: Shayne Chen <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Peter ChiuandFelix Fietkau 63f0053df0 wifi: mt76: mt7996: enable VHT extended NSS BW feature
Set SUPPORTS_VHT_EXT_NSS_BW to let the max BW capability correctly be
parsed by different devices.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Peter ChiuandFelix Fietkau 44e3233406 wifi: mt76: mt7996: fix bss wlan_idx when sending bss_info command
The bmc_tx_wlan_idx should be the wlan_idx of the current bss rather
than peer AP's wlan_idx, otherwise there will appear some frame
decryption problems on station mode.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Reviewed-by: Shayne Chen <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Peter ChiuandFelix Fietkau 527cbbc5ed wifi: mt76: connac: add support for dsp firmware download
Add FW_START_WORKING_PDA_DSP for the indication of starting DSP
firmware download, which is for phy-related control.
The firmware is transparent to the driver, but it's necessary for the
firmware download process.

Reviewed-by: Shayne Chen <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Shayne ChenandFelix Fietkau ece724cf56 wifi: mt76: mt7996: move radio ctrl commands to proper functions
Move radio enable/disable commands into functions for configuring
per-phy radio.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Lorenzo BianconiandFelix Fietkau cc58d5c4a9 mt76: mt7996: rely on mt76_sta_stats in mt76_wcid
mt76 now accounts station stats in mt76_sta_stats available in mt76_wcid
struct. Get rid of mt7996 private copy.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Bo JiaoandFelix Fietkau d07785c344 wifi: mt76: mt7996: disable WFDMA Tx/Rx during SER recovery
Stop WFDMA transaction to avoid potential unexpected issue while doing
system recovery.

Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 18:39:14 +02:00
Ryder LeeandFelix Fietkau edd8a830f6 wifi: mt76: add tx_nss histogram to ethtool stats
mt76_connac2_mac_fill_txs() counts tx_nss but ethtool doesn't show
stats. Add missing histogram accordingly.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 17:52:14 +02:00
Lorenzo BianconiandFelix Fietkau 25ec4b9102 wifi: mt76: mt7996: rely on mib_stats shared definition
Get rid of private copy of mib_stats structure.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 17:50:24 +02:00
Ryder LeeandFelix Fietkau 251c363c30 wifi: mt76: mt7996: drop return in mt7996_sta_statistics
Avoid blocking other statistics sinfo->filled when txrate is
unavailable.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 17:50:24 +02:00
Ryder LeeandFelix Fietkau 2386cec860 wifi: mt76: mt7996: enable BSS_CHANGED_MU_GROUPS support
The Group ID Management frame is an Action frame of category VHT.
It is transmitted by the AP to assign or change the user position
of a STA for one or more group IDs.

Also, sniffer can use a given group id to monitor STA that belongs
to that group.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 17:50:24 +02:00
Ryder LeeandFelix Fietkau 5c28e17f8c wifi: mt76: mt7996: fix header translation logic
When header translation failure is indicated, the hardware will insert
an extra 2-byte field containing the data length after the protocol
type field. This happens either when the LLC-SNAP pattern did not match,
or if a VLAN header was detected.

The previous commit accidentally breaks the logic, so reverts back.

Fixes: 27db47ab1f47 (wifi: mt76: mt7996: enable mesh HW amsdu/de-amsdu support)
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-06-22 17:50:24 +02:00
Ryder LeeandFelix Fietkau 5b7519be2b wifi: mt76: mt7996: fix endianness of MT_TXD6_TX_RATE
To avoid sparse warning:
sparse: warning: invalid assignment: |=
sparse:    left side has type restricted __le32
sparse:    right side has type unsigned lon

Fixes: 15ee62e73705 ("wifi: mt76: mt7996: enable BSS_CHANGED_BASIC_RATES support")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/16fa938373e3b145cb07a2c98d2428fea2abadba.1682285873.git.ryder.lee@mediatek.com
2023-06-22 17:49:09 +02:00
Lorenzo BianconiandFelix Fietkau 150e2d0ffc wifi: mt76: mt7996: fix possible NULL pointer dereference in mt7996_mac_write_txwi()
Fix possible NULL pointer dereference on mvif pointer in
mt7996_mac_write_txwi routine.

Fixes: 15ee62e73705 ("wifi: mt76: mt7996: enable BSS_CHANGED_BASIC_RATES support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/2637628a84f42ad6d7b774e706f041d5b45c8cb5.1685269638.git.lorenzo@kernel.org
2023-06-22 17:48:56 +02:00
Lorenzo BianconiandFelix Fietkau db5a8f70ff wifi: mt76: move shared mac definitions in mt76_connac2_mac.h
Move some mac shared definitions between mt7996, mt7921 and mt7915 in
mt76_connac2_mac.h.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:44:46 +02:00
Lorenzo BianconiandFelix Fietkau c09f943d4f wifi: mt76: add mt76_connac_gen_ppe_thresh utility routine
gen_ppe_thresh routine is shared between mt7615, mt7915, mt7921 and
mt7996 so move it in mt76_connac module.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:37:59 +02:00
Lorenzo BianconiandFelix Fietkau 28ea992ce8 wifi: mt76: get rid of unused sta_ps callbacks
sta_ps callback is just an empty stub for most of the drivers,
so get rid of them.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:37:59 +02:00
Lorenzo BianconiandFelix Fietkau 482d2a765b wifi: mt76: move irq_tasklet in mt76_dev struct
irq_tasklet struct is used by most of the drivers (e.g. mt7915, mt7921,
mt7615, mt7663 and mt7996) so move it in common code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:37:59 +02:00
Ryder LeeandFelix Fietkau 88d1b002d9 wifi: mt76: mt7996: enable mesh HW amsdu/de-amsdu support
This enables HW offloading amsdu/de-amsdu support for 802.11s mesh
interface.

Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-18 11:35:57 +02:00
Ryder LeeandFelix Fietkau e3b5a8cc52 wifi: mt76: mt7996: enable configured beacon tx rate
The user is allowed to change beacon tx rate (HT/VHT/HE) from hostapd.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:46:25 +02:00
Ryder LeeandFelix Fietkau a18bf4816a wifi: mt76: mt7996: enable BSS_CHANGED_MCAST_RATE support
Similar to BSS_CHANGED_BASIC_RATES, this enables mcast rate
configuration through fixed rate tables.

Signed-off-by: Ryder Lee <[email protected]>
Change-Id: Ifc305e8c7de9a7df4ad5f856e2097d721a886aaa
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:46:25 +02:00
Ryder LeeandFelix Fietkau f863beedb6 wifi: mt76: mt7996: enable BSS_CHANGED_BASIC_RATES support
The connac3 removes fixed rate fields to reduce txd size and introduces
global rate tables (64 entries) for rate setting. Driver needs to fill
the corresponding idx in MT_TXD6_TX_RATE while tx, and push mt76_rate
into predifined table at bootup stage so that  mvif->basic_rates_idx
can immediately switch out once setting changes.

spe_idx is also needed for fixed rate frames, and will be updated by
future patches.

Note that all table entries are shared across driver and firmware
(i.e.TxBF), hence adding MT7996_BASIC_RATES_TBL to reflect mapping
status.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:46:25 +02:00
Ryder LeeandFelix Fietkau 98fbca7a6f wifi: mt76: mt7996: enable coredump support
Host triggered and catastrophic event triggered firmware core dumping
for basic firmware issues triage, including state reporting, function
calltrace and MCU memory dump.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:36:20 +02:00
Ryder LeeandFelix Fietkau be1ff24e87 wifi: mt76: mt7996: add full system reset knobs into debugfs
Add testing points into debugfs to trigger firmware assert and enable
full system recovery. Also rename knob "fw_ser" to a clear-cut name
"sys_recovery".

Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:36:20 +02:00
Bo JiaoandFelix Fietkau b7a6c0efff wifi: mt76: mt7996: enable full system reset support
Add mt7996_reset() and refactor mt7996_mac_reset_work() to support
full system recovery.

Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:36:20 +02:00
Sean WangandFelix Fietkau 46f28e7574 wifi: mt76: mt7921: enable p2p support
Introduce p2p-go/p2p-client support to mt7921 driver

CONNECTION_P2P_GC/GO is not supported with the current firmware
so we added mt76_dev to mt76_connac_mcu_sta_basic_tlv signature to
use CONNECTION_INFRA_STA/AP instead for p2p-client and p2p-go
respectively to make it work.

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 17:36:20 +02:00
StanleyYP WangandFelix Fietkau 821caac520 wifi: mt76: mt7996: fix eeprom tx path bitfields
Swap the tx path bitfields of band1 and band2 to read correct setting.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: StanleyYP Wang <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 16:10:14 +02:00
Peter ChiuandFelix Fietkau 9ae2569bdb wifi: mt76: mt7996: remove mt7996_mcu_set_pm()
Currently using BSS_INFO_PS command will sometimes cause packet drop in
hw rx queue.
Temporarily remove this function until finding the cause.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 16:10:14 +02:00
Peter ChiuandFelix Fietkau 3244d17678 wifi: mt76: mt7996: init mpdu density cap
Init mpdu density based on the hardware capability to prevent rx drop.

Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 16:10:14 +02:00
Peter ChiuandFelix Fietkau 210a558afc wifi: mt76: mt7996: fix pointer calculation in ie countdown event
Fix the tail and data pointers. The rxd->len in mt7996_mcu_rxd does not
include the length of general rxd. It only includes the length of
firmware event rxd. Use skb->length to get the correct length.

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]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 16:10:14 +02:00
Shayne ChenandFelix Fietkau 207c92bbcd wifi: mt76: mt7996: remove unused eeprom band selection
Tri-band chipsets support one band on each a-die, so remove the unused
definition of eeprom band selection.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 16:10:14 +02:00
Shayne ChenandFelix Fietkau 16a246675a wifi: mt76: mt7996: let non-bufferable MMPDUs use correct hw queue
Pass qid into mt7996_mac_write_txwi() to let the tx descriptor of
non-bufferable MMPDUs be filled with correct hw queue index.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 16:10:14 +02:00
Ryder LeeandFelix Fietkau d39bb7c81c wifi: mt76: mt7996: remove mt7996_mcu_beacon_check_caps()
Those capabilities have been added into ieee80211_bss_conf.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-04-17 15:53:06 +02:00
Felix Fietkau 8ecf551c6d wifi: mt76: set NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 on supported drivers
Drivers that do not generate IV/PN in software can safely rekey PTK0

Signed-off-by: Felix Fietkau <[email protected]>
2023-03-30 11:07:53 +02:00
Felix Fietkau efa44cb57f wifi: mt76: ignore key disable commands
This helps avoid cleartext leakage of already queued or powersave buffered
packets, when a reassoc triggers the key deletion.

Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2023-03-30 11:07:40 +02:00
Ryder LeeandFelix Fietkau ce2438aa61 wifi: mt76: mt7996: fix radiotap bitfield
The 11be generation's radiotap bitfields were wrongly copy-and-pasted
from 11ax driver, so fix them accordingly.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-02-28 11:19:52 +01:00
Yang LiandFelix Fietkau fc2ed0dfc5 wifi: mt76: mt7996: Remove unneeded semicolon
./drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:3136:3-4: Unneeded semicolon

Reported-by: Abaci Robot <[email protected]>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4059
Signed-off-by: Yang Li <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2023-02-28 11:19:52 +01:00