Commit Graph
2390 Commits
Author SHA1 Message Date
David BauerandFelix Fietkau e6c0948ada mt76: mt76x0: disable GTK offloading
When operating two VAP on a MT7610 with encryption (PSK2, SAE, OWE),
only the first one to be created will transmit properly encrypteded
frames.

All subsequently created VAPs will sent out frames with the payload left
unencrypted, breaking multicast traffic (ICMP6 NDP) and potentially
disclosing information to a third party.

Disable GTK offloading and encrypt these frames in software to
circumvent this issue. THis only seems to be necessary on MT7610 chips,
as MT7612 is not affected from our testing.

Signed-off-by: David Bauer <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Ryder LeeandFelix Fietkau 994893d38d mt76: always use WTBL_MAX_SIZE for tlv allocation
Simplify WTBL defines.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau 781911f167 mt76: mt7921: removed unused definitions in mcu.h
Get rid of the following definitions in mt7921/mcu.h since they are not
actually used:
- MT7921_WTBL_UPDATE_MAX_SIZE
- MT7921_STA_UPDATE_MAX_SIZE
- MT7921_WTBL_UPDATE_BA_SIZE

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Nigel ChristianandFelix Fietkau b59e367747 mt76: mt7921: remove unnecessary variable
In mt7921_pm_set() the variable "ret" is initialized to zero
and then returned. Remove it and return zero.

Signed-off-by: Nigel Christian <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau ae6473f1d2 mt76: mt7921: enable random mac addr during scanning
Notify mac80211 mt7921 devices support random mac address during hw
frequency scanning

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:30:00 +01:00
Lorenzo BianconiandFelix Fietkau b09cc86445 mt76: dma: do not report truncated frames to mac80211
If the fragment is discarded in mt76_add_fragment() since shared_info
frag array is full, discard truncated frames and do not forward them to
mac80211.

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-02-14 11:27:25 +01:00
Sander VanheuleandFelix Fietkau 2659f6c6ea mt76: mt7615: support loading EEPROM for MT7613BE
EEPROM blobs for MT7613BE radios start with (little endian) 0x7663,
which is also the PCI device ID for this device. The EEPROM is required
for the radio to work at useful power levels, otherwise only the lowest
power level is available.

Suggested-by: Georgi Vlaev <[email protected]>
Tested-by: Stijn Segers <[email protected]>
Signed-off-by: Sander Vanheule <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:23:30 +01:00
Felix Fietkau 892f74d37e mt76: mt7915: fix tx skb dma unmap
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:21:51 +01:00
Felix Fietkau b0ba039bc2 mt76: mt7615: fix tx skb dma unmap
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:21:51 +01:00
Felix Fietkau 26658849a4 mt76: mt7615: fix key set/delete issues
There were multiple issues in the current key set/remove code:
- deleting a key with the previous key index deletes the current key
- BIP key would only be uploaded correctly initially and corrupted on rekey

Rework the code to better keep track of multiple keys and check for the
key index before deleting the current key

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 11:21:34 +01:00
Lorenzo BianconiandFelix Fietkau 47eb00e134 mt76: mt7663: introduce coredump support
Similar to mt7921 devices, introduce coredump support for mt7663 chipset

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 5f4f6792fb mt76: mt7921: add coredump support
Introduce coredump support to mt7921 driver.

The coredump would be produced when MCU met the fatal error or driver
sent out the specific cmd to force trigger it.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 0d95c6ad17 mt76: mt7921: enable MSI interrupts
Enable MSI interrupts for mt7921 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 633a1cbd8f mt76: mt7921: introduce regdomain notifier support
Register regdomain notifier to determine the channel domain the hw scan
should rely on.

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau f8d1ec5e6e mt76: mt7921: introduce Runtime PM support
Introduce runtime PM to mt7921 driver

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 1ccf6a9c60 mt76: mt7921: rely on mt76_connac_mcu module for suspend and WoW support
Rely on mt76_connac_mcu module for suspend and WoW support and remove
duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 59e682497d mt76: mt7921: rely on mt76_connac_mcu module for sched_scan and hw_scan
Rely on mt76_connac_mcu module for sched_scan and hw_scan and remove
duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 2beb9c9530 mt76: mt7921: rely on mt76_connac_mcu common library
Rely on mt76_connac_mcu common library and remove duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 71f9f09ee9 mt76: mt7921: introduce PM support
Introduce suspend/resume and WoW (Wake-on-WoWLAN) support to mt7921
driver to allow remote wakeu-up from the suspend state.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau cb99bf4655 mt76: mt7921: introduce beacon_loss mcu event
If device has enabled beacon hw filter rx beacons are not reported to
the host. Introduce beacon_loss mcu event to trigger mac80211 mlme
connection state machine in this configuration.
IEEE80211_VIF_BEACON_FILTER has not set in vif flags since hw beacon
filter is not enabled yet

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau e67d5216f1 mt76: mt7921: introduce support for hardware beacon filter
Introduce support for hw beacon filter available in the mt7921 firmware.

According to mt7921e firmware, enabling hardware filter would rely on
mt7921_mcu_uni_bss_bcnft and disabling hardware filter still rely on legacy
mt7921_mcu_set_bss_pm.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 5aa798ee56 mt76: mt7921: introduce 802.11 PS support in sta mode
Enable 802.11 power-save support available in mt7921 firmware

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau b16cf6e269 mt76: mt7921: introduce schedule scan support
introduce schedule scan to control mt7921 firmware to do background scan in
defined plan to see if the matched SSID is available.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 9f37baecf5 mt76: mt7921: add debugfs support
Add debugfs support to dump driver statistics and hardware details.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 39d6f4851b mt76: mt7921: introduce mt7921e support
Introduce support for mt7921e 802.11ax (Wi-Fi 6) 2x2:2SS chipset.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau a9e68410b9 mt76: mt7921: add ieee80211_ops
Filling ieee80211_ops with the mt7921 operations.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 1cecf9c3da mt76: mt7921: add EEPROM support
Add EEPROM support to MT7921 to determine the capability the card has
such as indentificaiton, MAC address, the band and antenna number the
card able to support.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 92c1717f9a mt76: mt7921: add DMA support
Add DMA and register access support to MT7921e driver to set up the link
for the data movement between the host and MT7921 MAC, or the host and
MT7921 MCU.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau 8ecf3a50e7 mt76: mt7921: add MCU support
MT7921 contains a microprocessor with which the host can use command/event
to communicate to implement offload features such as establish connection,
hardware scan and so on. The host has to download the ROM patch, RAM
firmware and finally activate the MCU to complete the MT7921
initialization.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Sean WangandFelix Fietkau c4ccfc6634 mt76: mt7921: add MAC support
Add Rx packet description parsing, Tx packet description compositon, handle
packet recycling and provide MAC information mt76 core needs to support
mac80211.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 16be142e40 mt76: mt76_connac: move pm utility routines in mt76_connac_lib module
Move power_save common code shared between mt7663 and mt7921 in
mt76_connac module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 2da59aacdd mt76: mt76_connac: move pm data struct in mt76_connac.h
Move pm mt7663 data structure in mt76_connac.h introducing
mt76_connac_pm data struct. This is a preliminary patch to share pm code
between mt7663 and mt7921

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 9856236ab4 mt76: mt76_connac: move WoW and suspend code in mt76_connac_mcu module
Move WoW and suspend code in mt76_connac_mcu module in order to be reused in
mt7615 and mt7921 drivers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau c88859180c mt76: mt76_connac: move hw_scan and sched_scan routine in mt76_connac_mcu module
Move hw_scan/sched_scan in mt76_connac_mcu module in order to be reused in
mt7615 and mt7921 drivers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:43 +01:00
Lorenzo BianconiandFelix Fietkau 50349a8664 mt76: mt76_connac: create mcu library
Introduce mt76_connac common mcu library for code sharing between mt7615 and
mt7921 devices

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:43 +01:00
Lorenzo BianconiandFelix Fietkau 261d184ceb mt76: introduce mt76_vif data structure
Introduce mt76_vif data structure to share common fields between
mt7615_vif and mt7921_vif and create a mcu common library

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:43 +01:00
Lorenzo BianconiandFelix Fietkau 8696919d9a mt76: dma: fix a possible memory leak in mt76_add_fragment()
Fix a memory leak in mt76_add_fragment routine returning the buffer
to the page_frag_cache when we receive a new fragment and the
skb_shared_info frag array is full.

Fixes: b102f0c522cf6 ("mt76: fix array overflow on receiving too many fragments for a packet")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Felix Fietkau <[email protected]>
2021-01-27 17:25:22 +01:00
Felix Fietkau 2f85aa5cbc mt76: mt7915: avoid writes to MT_PCIE_RECOG_ID when not using gen1 devices
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-26 19:33:34 +01:00
Felix Fietkau 0714890bf0 mt76: mt7615: reduce VHT maximum MPDU length
With a maximum length of 7991, the radio sometimes locks up under load when
transmitting A-MSDU frames to lots of stations. Using the lower limit makes
it work reliably again

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-26 19:33:34 +01:00
Felix Fietkau 4eb5caaf6c mt76: reduce q->lock hold time
Instead of holding it for the duration of an entire station schedule run,
which can block out competing tasks for a significant amount of time,
only hold it for scheduling one batch of packets for one station.
Improves responsiveness under load

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-24 12:26:58 +01:00
Felix Fietkau 8c796a3378 mt76: mt7915: only set int1 when using the second hif
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-22 14:55:43 +01:00
Felix Fietkau 8dc5d4a0da Revert "mt76: mt7915: fix vif sta index for DBDC"
This reverts commit c4c9c402d1.
Superseded by making vif index global

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-21 16:30:55 +01:00
Felix Fietkau be2bea66d6 mt76: mt7915: detect wrong nss eeprom parameter on dbdc cards
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-21 12:49:30 +01:00
Felix Fietkau fb3e5ce1eb mt76: move vif_mask back from mt76_phy to mt76_dev
Since it is global for all drivers, it belongs to the main device

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-20 13:11:46 +01:00
Felix Fietkau dbaf0f4679 mt76: mt7915: make vif index per adapter instead of per band
The firmware treats it as global, so we need to avoid collisions here

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-20 13:11:46 +01:00
Felix Fietkau c828124ef9 mt76: mt7915: add support for using a secondary PCIe link for gen1
For performance reasons, mt7915 supports using 2 PCIE gen1 links on
platforms that don't support gen2.
Add support for using this to move traffic for a second DBDC band onto
a dedicated link

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-19 17:50:03 +01:00
Felix Fietkau eca2f0ec0d mt76: mt7915: fix command id for txbf action
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-19 17:50:03 +01:00
Felix Fietkau c4c9c402d1 mt76: mt7915: fix vif sta index for DBDC
Since vif indexes are per-phy, we need to factor in the phy index to avoid
collisions on the WTBL index

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-19 17:50:03 +01:00
Felix Fietkau fa3d334a0e mt76: fix crash on tearing down ext phy
Only clear dev->phy2 after the phy is gone, the driver may still need to access
it until shutdown is complete

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-19 17:50:03 +01:00
Felix Fietkau cc3f23d1e6 mt76: mt7915: bring up the WA event rx queue for band1
This is needed for DBDC cards to work correctly on both bands simultaneously

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-19 11:06:13 +01:00