228 Commits
Author SHA1 Message Date
Felix Fietkau c4e4982fa9 mt7603: set IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN
The hardware cannot report accurate tx A-MPDU length information, so tell rate
control to ignore it. Improves tx rate selection

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-16 22:35:17 +01:00
Felix Fietkau 4bcb2f9fe2 mt7603: fix txd q_idx field value
Use 802.11e ACI values - the vendor driver does the same

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-16 19:56:18 +01:00
Felix Fietkau 9d11596ec6 mt7603: discard bogus tx status data
If parsing tx status information fails, do not report any rates to mac80211

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-16 19:55:42 +01:00
Felix Fietkau e45db12888 mt7603: fix tx status info
Reporting A-MPDU length from txs does not work, because only completed
subframes are reported. Trying to aggregate tx status report for one
completed A-MPDU does not work, because individual subframe retries can
be different.
Do not report A-MPDU length > 1 and pass individual subframe tx status
information to mac80211 to fix rate control errors

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-16 19:53:45 +01:00
Felix Fietkau 63bf183451 mt76: add channel switch announcement support
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-15 14:27:02 +01:00
Felix Fietkau d273ddd9e3 mt7603: fix number of frames limit in .release_buffered_frames
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-15 12:50:01 +01:00
Felix Fietkau f84b008222 mt76: fix tx status reporting for non-probing frames
On MT76x2, the hardware does not report tx status in the FIFO register,
if the packet id is 0.
Change the allocation of packet IDs to use 0 for no-ack packets, 1 for
non-probing packets and 2-255 for packets with tx status requested.
Fixes rate control issues

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-11 15:24:32 +01:00
Felix Fietkau 48fb0116f0 mt7603: fix CF-End transmit rate when 11b stations are connected
Use a CCK rate in that case

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-30 17:08:40 +01:00
Felix Fietkau 24ec040a97 mt7603: fix BSSID configuration in AP mode
Fixes BSSID value in self-generated frames, such as CF-End

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-30 16:41:17 +01:00
Felix Fietkau 962152bd73 mt7603: fix WMM TXOP limit configuration
The config registers are swapped, AC2/AC3 comes before AC1/AC0

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-30 16:10:59 +01:00
Felix Fietkau 2a092e2b1d mt7603: fix per-rate retry accounting
Each rate retry slot takes up MT7603_RATE_RETRY tries, and cannot be altered
based on mac80211 provided rate retry counts.

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-29 19:42:15 +01:00
Felix Fietkau 148219d572 mt7603: fix checkpatch issues
Signed-off-by: Felix Fietkau <[email protected]>
2018-12-29 13:27:35 +01:00
Felix Fietkau bce700dd0c mt7603: fix signal strength reporting on single-stream devices
The second chain value is 0 if the second chain is disabled, which
would make the reported signal strength 0 as well.

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-29 13:03:20 +01:00
Weijie GaoandFelix Fietkau 8178f0d2ce mt7603: apply efuse data only when it exists
Some mt7603e chip has empty efuse data.
In this case driver will crash due to dereferencing NULL pointer.

The mt7603_eeprom_load will return success directly if the chip has no efuse
data and dev->mt76.otp.data is left empty, i.e. NULL pointer.
The mt7603_eeprom_init will then try to dereference dev->mt76.otp.data
without checking its value.

This patch adds a check around these codes to prevent kernel panic.

Signed-off-by: Weijie Gao <[email protected]>
2018-12-11 14:11:39 +01:00
Felix Fietkau 294e095a48 mt7603: reset DMA scheduler on MT7628
Should improve stability

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-09 17:18:12 +01:00
Felix Fietkau 6203d46fcc mt7603: add support for setting transmit power
Signed-off-by: Felix Fietkau <[email protected]>
2018-12-06 14:38:07 +01:00
Felix Fietkau 2c8e9acb40 mt7603: initialize channel maximum power from eeprom data
Signed-off-by: Felix Fietkau <[email protected]>
2018-12-06 14:13:29 +01:00
Felix Fietkau 9d009be68d mt7603: add dynamic sensitivity tuning based on false CCA events
This reduces sensitivity in cases where it could help throughput/stability.

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-05 18:26:20 +01:00
Felix Fietkau 417ab779a0 mt7603: improve recovery from PSE reset failure
Only clear reset status and switch to DMA reset after 3 tries.

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-05 15:31:43 +01:00
Felix Fietkau da00af00c5 mt7603: clear bit 18 in MT_SEC_SCR to fix ICV error
Ported from vendor driver

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-04 12:22:21 +01:00
Felix Fietkau 0ad998b6ff mt7603: increase aggregation limits (based on vendor driver changes)
Signed-off-by: Felix Fietkau <[email protected]>
2018-12-04 12:22:21 +01:00
Felix Fietkau 8929a6e6b7 mt7603: increase MCU timeout
Sometimes during startup, the MCU response time can be quite long,
especially in newer versions. This change prevents false timeout errors

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-04 12:22:21 +01:00
Felix Fietkau 80843237fa mt7603: implement code for adjusting energy detect CCA thresholds
Ported from the reference driver.
Should fix compliance with ETSI rules on preventing transmission while
energy detect values are above the threshold.
Relax rules for non-ETSI regdomains

Signed-off-by: Felix Fietkau <[email protected]>
2018-12-03 18:03:52 +01:00
Felix Fietkau 44bb37288c mt7603: fix CAB queue flush mask
Only flush queues belonging to hardware BSS 0 (and sub interfaces)

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 22:29:23 +01:00
Felix Fietkau d22feb00e9 mt7603: move cab queue enabling to pre-tbtt tasklet
It is not necessary to time the start of the queue in software, the hardware
already does that for us.
Move all processing into the pre-tbtt tasklet to get rid of a race condition
that could happen when the pre-tbtt tasklet takes too long

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 22:15:31 +01:00
Felix Fietkau 6ac9653037 mt7603: fix CAB queue limits
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 21:22:42 +01:00
Felix Fietkau 3ecb7f8974 mt7603: fix hardware queue assignment
The queues are ordered by priority. BK needs to be the first queue,
followed by BE

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 21:11:05 +01:00
Felix Fietkau cd456ca87f mt7603: disable broken support for WEP hardware encryption
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 15:03:26 +01:00
Felix Fietkau 2a136cb2fd mt7603: fix TKIP key setup
Rx and Tx MIC keys are swapped compared to the order provided by mac80211

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 14:55:27 +01:00
Felix Fietkau c3efb5d899 mt7603: add support for detecting MT7688 and single stream devices
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 14:34:05 +01:00
Felix Fietkau 00e03b990f mt7603: fix MT_WF_PHY_CR_RXTD_BASE definition
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 14:19:03 +01:00
Felix Fietkau 4063ae1ecb mt7603: check for PSE hang / stuck beacon first
Ensure that PSE reset is issued when necessary

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 13:55:37 +01:00
Felix Fietkau 31cd20eb6a mt7603: issue PSE reset on stuck beacon
Improves reliability of recovery

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-28 13:54:47 +01:00
Felix Fietkau 5fb60a7d7a mt7603: fix aggregation size handling
Do not step over the 32 subframe limit.
Fix staying under the limit

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 19:04:19 +01:00
Felix Fietkau da666a74a6 mt7603: issue PSE reset if firmware debug register indicates stuck queues
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 15:10:31 +01:00
Felix Fietkau b38fe7d531 mt7603: only issue PSE reset on PSE stuck
The reset can take quite a bit of time, so only issue it when necessary

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 15:04:47 +01:00
Felix Fietkau 94cebfc31a mt7603: fix handling lost interrupt events during watchdog reset
Schedule tx tasklet and rx napi poll after reset to ensure that processing
of DMA queues resumes

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 15:00:15 +01:00
Felix Fietkau a301decead mt7603: add back PSE client reset code
Should help with MT7628 reliability

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 13:52:04 +01:00
Felix Fietkau b3f82a33c0 mt7603: report PSE reset failures via debugfs
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 13:18:28 +01:00
Felix Fietkau 9428e34d1f mt7603: fix watchdog reset sequence
- issue PSE reset first
- skip DMA reset if PSE reset failed
- schedule tx after reset has completed

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 13:08:16 +01:00
Felix Fietkau 4734108318 mt7603: use mt7603_wtbl_clear on station removal
It removes more stale data from the WTBL

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-21 12:59:13 +01:00
Felix Fietkau c09e8a489f mt7603: fix buffering of tx packets for powersave clients
Use PSE registers to loop back any pending tx packets for a client that
just went to sleep back into the MCU rx queue.
Re-queue those packets to the tx queue immediately after a client wakes up.

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-20 16:18:22 +01:00
Felix Fietkau 82363abeaf mt7603: move tx status to rx queue 0
This makes it easier to loop powersave-filtered packets through the MCU queue
without involving the firmware

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-20 16:18:22 +01:00
Felix Fietkau b44d793e25 mt7603: clear PSE redirections before MCU init
Ensure that stale data from a previous run is cleaned up

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-20 16:18:01 +01:00
Felix Fietkau ca2c875ae6 mt7603: add support for accessing remapped registers via ops
Add wrappers for existing register ops

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-20 12:15:32 +01:00
Felix Fietkau 7c4c33c41e mt7603: skip efuse tx power data for mt7628
Sync with vendor driver behavior

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-20 12:15:32 +01:00
Felix Fietkau 42c5281187 mt7603: fix maximum frame size in scheduler init
Since hardware A-MSDU decap is disabled, use maximum A-MSDU size
as maximum packet size

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-17 17:56:07 +01:00
Felix Fietkau d22799b2c3 mt7603: reduce reserved pages for beacons
Only 4 interfaces are supported anyway

Signed-off-by: Felix Fietkau <[email protected]>
2018-11-17 17:56:07 +01:00
Felix Fietkau 749d5c3d2c mt7603: fix reserved page handling for mt7628
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-17 17:56:07 +01:00
Felix Fietkau 3873e827ed mt7603: fix MT_BMAP_0/MT_GROUP_THD_0 register initializion for mt7628
Signed-off-by: Felix Fietkau <[email protected]>
2018-11-17 17:34:19 +01:00