Commit Graph
100 Commits
Author SHA1 Message Date
Felix Fietkau 854c8d076a mt76: mt7915: move pci specific code back to pci.c
This avoids the need to check for the device type in mmio.c and makes the code
cleaner

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-22 23:00:52 +01:00
Felix Fietkau 3edb87cdf1 mt7915: formatting change to sync with upstream
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:56:31 +01:00
Felix Fietkau c9a4146404 sync with upstream
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-15 20:35:30 +01:00
Felix Fietkau d57dadb8c8 Revert "mt76: only kick tx queue if frames were queued"
This reverts commit fea36e0207.
When reaching that point, a frame has always been enqueued and we need
to kick the queue

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-14 20:07:45 +01:00
Felix Fietkau fea36e0207 mt76: only kick tx queue if frames were queued
Slightly reduces unnecessary device register accesses

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-04 12:44:50 +01:00
Felix Fietkau 047b9a9e78 mt76: mt7615: in debugfs queue stats, skip wmm index 3 on mt7663
The hardware only supports WMM index 0-2 and registers for index 3 return
bogus data.

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-03 20:09:05 +01:00
Felix Fietkau f703084f31 mt76: mt7915: process txfree and txstatus without allocating skbs
Reduces pressure on the memory allocator

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-03 18:02:47 +01:00
Felix Fietkau 833b9d7fcf mt76: allow drivers to drop rx packets early
This can be used to free received events without allocating an extra skb

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-03 18:01:54 +01:00
Felix Fietkau 678071ef70 mt76: mt7615: clear mcu error interrupt status on mt7663
Should fix issues with error recovery

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-03 10:50:10 +01:00
Felix Fietkau 71e08471ab mt76: eeprom: fix return code on corrected bit-flips
Ensure that the return code is 0 when data was read successfully

Signed-off-by: Felix Fietkau <[email protected]>
2021-12-02 17:21:47 +01:00
Felix Fietkau 688e30c7d8 firmware: update mt7921 firmware to version 20211014
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-29 15:08:10 +01:00
Felix Fietkau 094b3d8008 firmware: update mt7663 rebb firmware to 20200904171623
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-28 22:19:44 +01:00
Felix Fietkau 77fc6c439a mt76: mt7603: improve reliability of tx powersave filtering
Leave more time to abort transmissions (which could happen at low CCK rates)
Only warn if the last filter command is stuck

Signed-off-by: Felix Fietkau <[email protected]>
2021-11-25 20:13:29 +01:00
Felix Fietkau 7998a41d13 mt76: clear sta powersave flag after notifying driver
If the driver has configured the hardware to drop packets for a sta that was
in powersave mode, then clearing the flag too early opens up a small race
window during which packets could be dropped on wakeup

Signed-off-by: Felix Fietkau <[email protected]>
2021-11-25 13:42:34 +01:00
Felix Fietkau 1911486414 mt76: mt7915: improve wmm index allocation
Typically all AP interfaces on a PHY will share the same WMM settings, while
sta/mesh interfaces will usually inherit the settings from a remote device.
In order minimize the likelihood of conflicting WMM settings, make all AP
interfaces share one slot, and all non-AP interfaces another one.

Signed-off-by: Felix Fietkau <[email protected]>
2021-11-25 10:50:11 +01:00
Felix Fietkau a6451fea5a mt76: mt7615: improve wmm index allocation
Typically all AP interfaces on a PHY will share the same WMM settings, while
sta/mesh interfaces will usually inherit the settings from a remote device.
In order minimize the likelihood of conflicting WMM settings, make all AP
interfaces share one slot, and all non-AP interfaces another one.

This also fixes running multiple AP interfaces on MT7613, which only has 3
WMM slots.

Signed-off-by: Felix Fietkau <[email protected]>
2021-11-25 10:50:11 +01:00
Felix Fietkau 67f93aa9a2 mt76: mt7615: fix decap offload corner case with 4-addr VLAN frames
With 4-address mode VLAN frames, an internal header translation step fails,
leaving behind an extra 2-byte length field that must be reomved by the driver.
Add a check for this condition to fix receiving such packets

Signed-off-by: Felix Fietkau <[email protected]>
2021-11-23 11:49:04 +01:00
Felix Fietkau f0a5b1118f mt76: mt7915: fix decap offload corner case with 4-addr VLAN frames
With 4-address mode VLAN frames, an internal header translation step fails,
leaving behind an extra 2-byte length field that must be reomved by the driver.
Add a check for this condition to fix receiving such packets

Signed-off-by: Felix Fietkau <[email protected]>
2021-11-23 11:47:30 +01:00
Felix Fietkau f6bde7ba82 mt76: connac: fix unresolved symbols when CONFIG_PM is unset
mt76_connac_mcu_reg_* functions are always needed by connac based drivers

Fixes: 87f9bf24ea84 ("mt76: connac: move mcu reg access utility routines in mt76_connac_lib module")
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 13:24:17 +02:00
Felix Fietkau ebf5b23365 mt7615/mt7915: fix hwmon device name
the "-" character is rejected by the subsystem for device names

Signed-off-by: Felix Fietkau <[email protected]>
2021-10-12 15:21:02 +02:00
Felix Fietkau 1af0242d12 mt76: mt7915: replace a 64 bit divsion with a call to div_u64_rem
Fixes a build error on 32 bit targets

Signed-off-by: Felix Fietkau <[email protected]>
2021-10-11 21:52:21 +02:00
Felix Fietkau 5560b08f8e mt76: do not access 802.11 header in ccmp check for 802.3 rx skbs
Avoids false positive on detecting frags or encrypted mgmt frames

Signed-off-by: Felix Fietkau <[email protected]>
2021-10-11 12:07:49 +02:00
Felix Fietkau 8ee6446075 mt76: disable BH around napi_schedule() calls
napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq
handling, so it must not be called in a pure process context with BH enabled.

Signed-off-by: Felix Fietkau <[email protected]>
2021-09-24 17:54:42 +02:00
Felix Fietkau 56b842b72a mt76: mt7915: fix wmm index on DBDC cards
WMM index range needs to be split between both PHYs if a second PHY exists.
The condition for that was accidentally written as checking if the vif PHY
is the secondary one

Signed-off-by: Felix Fietkau <[email protected]>
2021-09-08 17:46:50 +02:00
Felix Fietkau fa6504aceb Revert "mt76: mt7915: checkpatch cleanup"
Will be replaced by updated commits later

This reverts commit 4f48ba4b02.
2021-09-08 16:14:22 +02:00
Felix Fietkau 74dedf9352 mt76: mt7615: fix skb use-after-free on mac reset
When clearing all existing pending tx slots, mt76_tx_complete_skb needs to
be used to free the skbs, to ensure that they are cleared from the status
list as well.

Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2021-07-21 07:25:05 +02:00
Felix Fietkau bbebea7d6d Revert "mt76: fix mt76_rates for the multiple devices"
Fix rate values for MT7915 and MT7921

This reverts commit ca64a36908.

Signed-off-by: Felix Fietkau <[email protected]>
2021-07-15 20:09:39 +02:00
Felix Fietkau 7f5ea5e2fd mt7915: check return code of sysfs_create_link
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-18 19:20:50 +02:00
Felix Fietkau 624c681ef0 mt76: mt7921: enable VHT BFee capability
Enables VHT beamformee functionality

Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-10 13:26:14 +02:00
Felix Fietkau 22b690334c mt76: mt7915: do not fail if the cooling device could not be registered
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-06 09:39:18 +02:00
Felix Fietkau d1652e8af9 Revert "mt76: connac: do not schedule wake_work if the runtime-pm is disabled"
This reverts commit 53d915a23b.
Superseded by "mt76: mt7615: do not set MT76_STATE_PM at bootstrap"

Signed-off-by: Felix Fietkau <[email protected]>
2021-06-02 08:30:26 +02:00
Felix Fietkau 10548aef1f mt76: mt7915: improve error recovery reliability
- Remove no-op code for queue lock/unlock, which is no longer needed
- Set a missing DMA flag
- Wait for full completion of error recovery before restarting tx
- Schedule IRQ tasklet to ensure that IRQ mask gets written

Signed-off-by: Felix Fietkau <[email protected]>
2021-06-01 23:06:50 +02:00
Felix Fietkau 757b93f4b1 mt76: mt7921: remove leftover 80+80 HE capability
Fixes interop issues with some APs that disable HE Tx if this is present

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-28 13:56:23 +02:00
Felix Fietkau bddc1db76d mt76: mt7915: drop the use of repeater entries for station interfaces
There are firmware or hardware issues, which are currently causing tx hangs
when attempting to use these interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-25 18:45:09 +02:00
Felix Fietkau 9d736545bb mt76: mt7915: disable pre-calibration support for now
It needs more testing and more bugfixes until it is ready

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-15 09:09:22 +02:00
Felix Fietkau 28b162366d mt76: fix calling mt76_get_of_eeprom with an offset for pre-cal data
The device tree partition offset needs to be added to the function argument,
instead of overwriting it.
Fixes an issue where wrong EEPROM data was sent to the firmware as
pre-calibration data on MT7915.

Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-15 08:07:54 +02:00
Felix Fietkau 3511fd4303 mt76: validate rx A-MSDU subframes
Mitigate A-MSDU injection attacks (CVE-2020-24588) by detecting if the
destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP)
header, and if so dropping the complete A-MSDU frame. This mitigates
known attacks, although new (unknown) aggregation-based attacks may
remain possible.

This defense works because in A-MSDU aggregation injection attacks, a
normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means
the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042
header. In other words, the destination MAC address of the first A-MSDU
subframe contains the start of an RFC1042 header during an aggregation
attack. We can detect this and thereby prevent this specific attack.
For details, see Section 7.2 of "Fragment and Forge: Breaking Wi-Fi
Through Frame Aggregation and Fragmentation".

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-13 09:00:04 +02:00
Felix Fietkau c7dd54a22e mt76: connac: skip wtbl reset on sta disconnect
It should only be done on adding entries

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-10 14:10:54 +02:00
Felix Fietkau a9bc4d94b7 mt76: intialize tx queue entry wcid to 0xffff by default
Avoid accidentally mapping them to WCID 0 on completion

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-09 22:49:09 +02:00
Felix Fietkau 628eee9c38 mt76: fill queue entry wcid for all skbs with a station
Fixes issues with tx completion

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-09 22:48:36 +02:00
Felix Fietkau 9e928ac1ea mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails
Fixes AQL issues on full queues, especially with 802.3 encap offload

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-09 20:26:08 +02:00
Felix Fietkau 35f189cf81 mt76: mt7915: fix uninitialized variable in MSI error handling
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 20:01:01 +02:00
Felix Fietkau 18513ba5fb mt76: mt7915: add support for tx status reporting
For now, this only reports ACK status

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 19:50:30 +02:00
Felix Fietkau e1f07d7f1c mt76: mt7603: avoid use of ieee80211_tx_info_clear_status
It overwrites mt76_tx_cb data in the skb

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 19:50:30 +02:00
Felix Fietkau 3b4ca5b09e mt76: mt7615: avoid use of ieee80211_tx_info_clear_status
It overwrites mt76_tx_cb data in the skb

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 19:50:30 +02:00
Felix Fietkau 27d468d094 mt76: mt7915: rework tx rate reporting
Instead of attaching the last reported rate to tx packets, use
ieee80211_tx_status_ext to immediately pass the rate to mac80211 after
receiving it from the firmware.
Preparation for implementing full tx status reporting

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 18:51:43 +02:00
Felix Fietkau c6ae95d43e mt76: improve tx status codepath
Use ieee80211_tx_status_ext instead of ieee80211_free_skb and
ieee80211_tx_status. This makes it compatible with 802.3 encap offload
and improves performance by removing a redundant sta lookup

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 17:15:27 +02:00
Felix Fietkau caedb4c4ee mt76: mt7615: fix fixed-rate tx status reporting
Rely on the txs fixed-rate bit instead of info->control.rates

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 14:07:54 +02:00
Felix Fietkau c9ab76dd93 mt76: mt7915: move mt7915_queue_rx_skb to mac.c
It is not really DMA specific, and moving it makes it possible to make some
functions in mac.c static

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 12:52:43 +02:00
Felix Fietkau 43b9c0a838 mt76: mt7921: fix max aggregation subframes setting
The hardware can only handle 64 subframes in rx direction and 128 for tx.
Improves throughput with APs that can handle more than that

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 11:56:24 +02:00
Felix Fietkau 554b50dabf mt76: connac: fix uninitialized HT A-MPDU setting field in STA_REC_PHY
The MT7921 firmware needs this to enable tx A-MPDU properly

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-07 11:55:12 +02:00
Felix Fietkau 5231e7300f mt7915: disable ASPM
The same is done on the other chips already, so it is very likely needed
on MT7915 as well

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-06 19:03:04 +02:00
Felix Fietkau e693f3e23e mt76: mt7915: add MSI support
Move IRQ processing to a tasklet, similar to MT7615/MT7663

Signed-off-by: Felix Fietkau <[email protected]>
2021-05-06 18:59:30 +02:00
Felix Fietkau 0fc2136a61 mt76_connac_mcu: move mt76_connac_mcu_update_arp_filter outside of CONFIG_PM
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-05 13:03:28 +02:00
Felix Fietkau 42a2dddb70 mt76: mt7615: load ROM patch before checking patch semaphore status
For MT7663, the availability of the patch files is used to detect, which
corresponding firmware is going to be used (AP firmware or STA offload
firmware). If the ROM patch was already applied, it could attempt to
load the wrong firmware (without considering the alternative).

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-16 10:24:48 +02:00
Felix Fietkau 57a899ee3c mt76: mt7615: fix entering driver-own state on mt7663
Fixes hardware wakeup issues

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-16 09:36:45 +02:00
Felix Fietkau 23ecadd4af mt76: mt7615: fix hardware error recovery for mt7663
MT7663 uses different bits for communicating reset commands/status between MCU
and host. Also add an extra initial reset command.

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-16 09:36:45 +02:00
Felix Fietkau c71f609b39 mt76: sync with upstream changes
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-14 09:12:11 +02:00
Felix Fietkau 5ac02e22fb mt76: flush tx status queue on DMA reset
After DMA reset, tx status information for queued frames will never arrive.
Flush the queue to free skbs immediately instead of waiting for a timeout

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-13 20:10:31 +02:00
Felix Fietkau bf45b30d89 add missing file
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 19:54:54 +02:00
Felix Fietkau 6b293c411d mt76: mt7615: always add rx header translation tlv when adding stations
Ensures that header translation is disabled for interfaces that do not support
it.

Fixes: bb1262e7199b ("mt76: mt7615: add support for rx decapsulation offload")
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 16:59:59 +02:00
Felix Fietkau 028b7152b1 mt76: mt7921: remove 80+80 MHz support capabilities
This mode is not supported by the hardware

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-11 12:46:18 +02:00
Felix Fietkau 04122c8974 mt76: fix rx amsdu subframe processing
When receiving an A-MSDU containing only a single subframe, status->last_amsdu
is set, but no previous head is present in the rx A-MSDU queue.
In this case, the A-MSDU subframe will be held until the next one is received,
potentially causing significant extra latency.
Rework the code to make it easier to read and less convoluted, and release the
newly created head if status->last_amsdu is set.

Signed-off-by: Felix Fietkau <[email protected]>
2021-04-07 08:54:45 +02:00
Felix Fietkau 0ff3a336a8 mt7615,mt7915: fix a compiler warning
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-27 23:47:09 +01:00
Felix Fietkau 465dda65ee mt7615,mt7915: replace fw log 0-terminating code with wiphy info length limit
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-27 20:29:16 +01:00
Felix Fietkau b860906689 mt76: mt7615: fix chip reset on MT7622 and MT7663e
After chip reset, the DMA scheduler needs to be initialized as well.
Since the code is PCI/SoC specific, move it to pci_mac.c, so that it
can depend on a function in dma.c

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:26 +01:00
Felix Fietkau 4a22f2ffae mt76: mt7915: 0-terminate firmware log messages
Avoid including garbage from previous rx data in the printk messages

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:18 +01:00
Felix Fietkau a519c49a6a mt76: mt7615: 0-terminate firmware log messages
Avoid including garbage from previous rx data in the printk messages

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:09 +01:00
Felix Fietkau f66f8f41d4 mt76: mt7915: refresh repeater entry MAC address when setting BSSID
When disassociating and clearing the BSSID of a repeater entry used by a client
mode interface, the corresponding MAC address entry can get lost too, causing
the client interface to not be able to associate anymore.
Fix this by also refreshing the MAC address when setting the BSSID

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:16:06 +01:00
Felix Fietkau 09a1befde4 mt76: fix potential DMA mapping leak
With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap
could potentially inherit a non-zero value from stack garbage.
If this happens, it will cause DMA mappings for MCU command frames to not be
unmapped after completion

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-23 22:47:59 +01:00
Felix Fietkau be2f67e8d3 mt76: mt7915: fix key set/delete issue
Deleting a key with the previous key index deletes the current key
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-03-22 21:39:57 +01:00
Felix Fietkau bfa8d5a6a9 mt76: adjust to upstream API for enabling threaded NAPI
Create a second dummy device for tx napi to avoid making it threaded

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 17:36:54 +01:00
Felix Fietkau ab90451533 mt76: mt7915: only modify tx buffer list after allocating tx token id
Modifying the tx buffer list too early can leak DMA mappings

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-16 14:49:09 +01:00
Felix Fietkau 6a3cf95733 mt76: fix tx skb error handling in mt76_dma_tx_queue_skb
When running out of room in the tx queue after calling drv->tx_prepare_skb,
the buffer list will already have been modified on MT7615 and newer drivers.
This can leak a DMA mapping and will show up as swiotlb allocation failures
on x86.

Fix this by moving the queue length check further up. This is less accurate,
since it can overestimate the needed room in the queue on MT7615 and newer,
but the difference is small enough to not matter in practice.

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-16 14:46:04 +01:00
Felix Fietkau 289cd78045 mt76: mt7915: add support for rx decapsulation offload
For AP and Client mode, the hardware can pass received packets as 802.3 frames
that can be passed to the network stack as-is.

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:26:01 +01:00
Felix Fietkau 4b7a68634f mt76: mt7915: add rx checksum offload support
Set skb->ip_summed to CHECKSUM_UNNECESSARY if the hardware has validated
the IP and TCP/UDP checksum

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:26:01 +01:00
Felix Fietkau 0d7564d0d8 mt76: add support for 802.3 rx frames
Do not try to access the header when receiving them

Signed-off-by: Felix Fietkau <[email protected]>
2021-02-14 12:26:01 +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
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
Felix Fietkau 032ad7e025 mt76: mt7615: unify init work
Reduce code duplication and remove unnecessary exports

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-19 11:06:13 +01:00
Felix Fietkau 7a93026dd3 mt76: mt7915: fix eeprom DBDC band selection
When the EEPROM band fields contain default values, assign 2.4 GHz to the
first band and 5 GHz to the second.

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 12:25:56 +01:00
Felix Fietkau 25d7429bdc mt76: mt7915: fix eeprom parsing for DBDC
Annotate WIFI_CONF eeprom mask values with the byte number
Fix parsing per-band number of chains

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 12:25:56 +01:00
Felix Fietkau e6fe82acb1 mt76: mt7915: disable RED support in the WA firmware
It causes high CPU load on the WA core, which can lead to extra latency when
using many stations. Dropping packets for long queues is managed by mac80211
fq_codel instead

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 12:25:56 +01:00
Felix Fietkau 9c312f2ce2 mt76: mt7915: rework mcu API
Add support for passing flags for selecting the MCU target and query type
instead of trying to detect it based on the command id

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 12:25:56 +01:00
Felix Fietkau 64bd6f87e4 mt7915: fix crash on failure in pci_set_dma_mask
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-04 18:30:34 +01:00
Felix Fietkau a4539760b0 mt7915: update the testmode support to the latest upstream patch
Fixes warning with testmode support disabled

Signed-off-by: Felix Fietkau <[email protected]>
2021-01-04 18:30:34 +01:00