Commit Graph
616 Commits
Author SHA1 Message Date
Felix Fietkau 4490f93669 mt7603: remove WARN_ON_ONCE for workaround checks
It can happen during normal operation and it confuses users more than it
actually helps. workaround trigger counts are still available via
debugfs

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau c86c3a0f5c mt7603: remove watchdog reset on interface stop
It can be harmful in some cases

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau ea4c2a165a mt7603: rename MT_PSE_RESET register
It is actually a dummy control register used for communicating reset
state with the MCU firmware

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau e7eaa7c09b mt7603: rename mt7603_mac_reset to mt7603_pse_reset
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau c2bd89ee91 mt76x2: convert between per-chain tx power and combined output
Using both chains adds max. 3 dBm.

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 58364a2ac4 mt76x2: initialize channel power limits
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 1acde21849 mt76x2: add channel argument to eeprom tx power functions
Preparation for exposing maximum power to mac80211

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 0532315f76 mt76x2: increase OFDM SIFS time
Fixes throughput issues in combination with LDPC

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 2c1a77c74f mt76x2: fix transmission of encrypted management frames
Hardware encryption seems to break encrypted unicast mgmt tx.
Unfortunately the hardware TXWI header does not have a bit to indicate
that a frame is software encrypted, so sw-encrypted frames need to use a
different WCID. For that to work, the CCMP PN needs to be generated in
software, which makes things a bit slower, so only do it for keys that
also need to tx management frames.

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 82acc859fb mt7603: add missing include required on newer kernels
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 8c821aa63f mac80211: add missing include
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 0a0d16f817 mt76x2: sync tx power related values with reference driver
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:46 +01:00
Felix Fietkau 4bc9aa9da7 mt76x2: add more gain tuning based on the latest reference driver
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:46 +01:00
Felix Fietkau 60a4d67ca9 mt76x2: implement dynamic AGC tuning based on false packet detection count
Significantly improves radio performance

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:46 +01:00
Felix Fietkau cc588c5e32 mt76x2: sync channel gain value with latest reference driver
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:46 +01:00
Felix Fietkau fe7981687d mt76x2: fix LNA gain register annotation
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 73902dc8a7 mt76x2: add rx statistics registers
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 7dfb354d3b mt76: increase rx ring size for mt76x2
Should improve performance under load

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 941555ba89 mt76x2: clear drop mask when sending a PS response
Should make handling powersave clients more reliable

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 3e5afe7ba8 mt76x2: add helper function for setting drop mask
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 0dd8b688b2 mt76x2: clear per-WCID tx rate lookup register
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau f9d9c22491 mt76x2: clear drop flag for all WCIDs on init
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 8f1673a34b mt76x2: limit client WCID entries to 0-127
The rx WCID lookup table and the per-WCID rate table only have 128
entries. All further WCID entries are tx-only.

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 8e453b32e3 mac80211: move DT led configuration to the "led" child node
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau f5498d2aeb debugfs: add support for changing the LED pin
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 0b7984e252 mt7603: remove unnecessary mcu register read function
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Kristian EvensenandFelix Fietkau 9d36ff2ba4 mt76x2: Add PCI identifier for MT7602
MT7602 is also available as a PCI card, so add the missing identifier.

Signed-off-by: Kristian Evensen <[email protected]>
2017-11-16 20:34:45 +01:00
Lorenzo BianconiandFelix Fietkau 215edf1c17 mt7603: init: add ma80211 led callbacks
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-11-16 20:34:45 +01:00
Lorenzo BianconiandFelix Fietkau dfd64fc882 mt76x2: init: add ma80211 led callbacks
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-11-16 20:34:45 +01:00
Lorenzo BianconiandFelix Fietkau 27c64bcfd7 mt76: add led support using mac80211 led framework
use tpt-trigger as default trigger

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Kristian EvensenandFelix Fietkau 2f40e4ad49 mt76x2: Support using PCI ID as chip ID
On some routers, the manufacturer has made a mistake and left the chip
ID part of the EEPROM empty (it is set to 0x0000). One such router is
the ZBT-WE1026-5G (equipped with MT7612), and the consequence is that
the EEPROM check fails and the 5GHz wifi does not work at all. When
setting the chip ID to 0x7612 manually, the 5GHz wifi works fine.

When looking at EEPROM of the WE1026 (and other devices equipped with
mt76x2), I see that the PCI ID is always set to a valid value (7612 or
7662). This PR works around the issue of an empty chip ID by using the
PCI ID, if chip ID is 0. After applying this PR/patch manually to mt76,
the 5GHz on the WE1026 works out of the box. Since the PCI ID is only
used if chip ID is empty, devices with correct EEPROMs are not affected.

Signed-off-by: Kristian Evensen <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 4d83561ee4 mt76x2: add LED register definitions
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 1b8c8a035a mt7603: add LED definition registers
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 20:34:45 +01:00
Rosen PenevandFelix Fietkau 5e49aa933c Fix errors found by cppcheck
Mismatching declarations as well as unused results.

Signed-off-by: Rosen Penev <[email protected]>
2017-11-16 20:34:45 +01:00
Lorenzo BianconiandFelix Fietkau 1dae8f0e57 mt7603: mcu: remove unused parameter in mt7603_mcu_msg_alloc() signature
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-11-16 20:34:45 +01:00
Lorenzo BianconiandFelix Fietkau 28957755ae mt76x2: mcu: remove unused parameter in mt76x2_mcu_msg_alloc signature
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-11-16 20:34:45 +01:00
Felix Fietkau 1be430fc8a mt76x2: fix tx status ampdu length corner case
Sometimes the code would return a status update to mac80211 with a-mpdu
length of 0, leading to a crash in minstrel.

Make the logic of counting a-mpdu burst length easier to follow and add
an extra check to prevent this issue from happening.

Signed-off-by: Felix Fietkau <[email protected]>
2017-10-12 12:43:27 +02:00
Lorenzo BianconiandFelix Fietkau d5e945e9b2 mt7603: mcu: fix indentation of mcu command definition
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-09-25 20:25:12 +02:00
Lorenzo BianconiandFelix Fietkau 21f20b46e3 mt7603: mac: fix register configuration in mt7603_rx_dma_busy()
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-09-09 17:45:15 +02:00
Lorenzo BianconiandFelix Fietkau cb83f3329f mt7603: mac: fix logic in mt7603_tx_hang()
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-09-09 17:45:07 +02:00
Lorenzo BianconiandFelix Fietkau 3c4c9a647e tx: move state check in mt76_txq_send_burst()
Move device state check in mt76_txq_send_burst() in order to be more
reactive in stopping tx process during hw reset

Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-07-17 10:22:05 +02:00
Lorenzo BianconiandFelix Fietkau 8dee788e05 mt7603: mac: stop netdev queues during watchdog reset
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-07-17 10:21:59 +02:00
Lorenzo BianconiandFelix Fietkau 8a649c3b1e mt7603: mac: code optimization
Remove unnecessary return instruction and time variable in
mt7603_mac_work()

Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-07-15 10:30:56 +02:00
Lorenzo BianconiandFelix Fietkau e90a81a552 mt7603: fix channel width fall back in TXWI
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-07-04 10:55:39 +02:00
Felix Fietkau c4e3deaa58 mt7603: use the real vif index in txwi header for normal tx.
Fixes rate control for multi-vif. Beacons and buffered multicast packets
still need the adjusted index

Signed-off-by: Felix Fietkau <[email protected]>
2017-07-01 16:53:18 +02:00
Felix Fietkau 32eab505a4 mt7603: set wtbl entry vif index
Signed-off-by: Felix Fietkau <[email protected]>
2017-07-01 16:46:34 +02:00
Lorenzo BianconiandFelix Fietkau cf4ba12871 mt7603: avoid tx rate sampling using no retransmissions
Since the TXWI has no room for the MRR reconfigure the MT_WTBL registers
using the sample rate as first tx rate for channel probing avoiding
very low TCP performance in a lossy environment

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-06-26 14:06:56 +02:00
Lorenzo BianconiandFelix Fietkau 01fb9ba096 mt7603: fix control/status retries count estimation
Refactor tx count computation for fixed_rate frames in status path

Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-06-26 14:06:44 +02:00
Felix Fietkau af326156d9 mt7603: change auto rate control register initialization
Allow the hardware to fall back if rates stop working, make the first
rate fail earlier.

Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-06-26 14:06:31 +02:00
Lorenzo BianconiandFelix Fietkau 70d225123f tx: fix AGGR burst length estimation
Use tx_info reference of last dequeued frame instead of the previous one
to compute 802.11 aggregate burst length

Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-06-16 15:27:34 +02:00