28 Commits
Author SHA1 Message Date
Felix Fietkau 0f06914acf mt76: mt7615: implement hardware reset support
When the firmware detects a problem, it needs the host to stop/reset DMA and
resume it again when the hardware state has been reset.

Signed-off-by: Felix Fietkau <[email protected]>
2020-01-31 16:37:02 +01:00
Felix Fietkau 80d3681b40 mt76: mt7615: implement probing and firmware loading on MT7622
MT7622 does not have a CR4 microcontroller, so it only uses its own N9
firmware.

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-01-30 14:04:37 +01:00
Felix Fietkau 13a4269a1b mt76: mt7615: add dma and tx queue initialization for MT7622
MT7622 queue mapping is different from MT7615 and requires an extra dma
scheduler init and a few register tweaks

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-01-30 13:34:20 +01:00
Felix Fietkau 92bafd4b1b mt76: mt7615: fix MT_INT_TX_DONE_ALL definition for MT7622
MT7622 uses more interrupt bits for queue tx completion events.
Enabling those extra bits is harmless on MT7615

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-01-30 13:33:18 +01:00
Ryder LeeandFelix Fietkau 2d22ef6187 mt76: mt7615: add per-phy mib statistics
Update per-phy mib counters every 500ms.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-01-27 17:47:51 +01:00
Ryder LeeandFelix Fietkau 15e1c29ed8 mt76: mt7615: add missing settings for simultaneous dual-band support
MT7615 supports dual-wiphy which means that it can run on 2.4G and 5GHz
channels simultaneously, and driver should configure each band.

Add missing register settings, and refine band related definitions to
avoid duplicate codes.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-12-27 15:15:07 +01:00
Lorenzo BianconiandFelix Fietkau ae25a4bf99 mt76: mt7615: introduce LED support
Initialize brightness_set and blink_set callbacks to
mt7615_led_set_brightness and mt7615_led_set_blink in order to enable
LED support in mt7615 driver

Tested-by: Deng Qingfang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-12-22 16:09:15 +01:00
Felix Fietkau 3ef5f3444a mt76: mt7615: measure channel noise and report it via survey
Read measurements every 100 ms and build a simple moving average

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-15 15:39:43 +01:00
Lorenzo BianconiandFelix Fietkau a589d095ee mt76: mt7615: add set_coverage class support
Add the capability to configure acktimeout for mt7615 driver. Moreover
configure slottime according to the value provided by mac80211

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-12-13 23:16:36 +01:00
Felix Fietkau c5585a7358 mt76: mt7615: initialize dbdc settings on interface add
Use the first two WMM slots for the primary phy and the second two for the
secondary phy.

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Felix Fietkau caa47af1d6 mt76: mt7615: add multiple wiphy support to the rx path
Program the RMAC CHFREQ registers to properly indicate the band that the
frames are received on.
Add some sanity checks to the programmed values, because the firmware
programs these registers differently

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Felix Fietkau bdcd45dd04 mt76: mt7615: add missing register init for dual-wiphy support
Initialize low-power beacon mode setting

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Felix Fietkau e5ea72ac71 mt76: mt7615: add multiple wiphy support for smart carrier sense
Use per-phy radio stats and tuning registers

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Felix Fietkau e6659d12d0 mt76: mt7615: add dual-phy support for mac80211 ops
Allows them to be used by a separately registered wiphy later

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Lorenzo BianconiandFelix Fietkau faf5e6fedd mt76: mt7615: read {tx,rx} mask from eeprom
Parse configured {tx,rx} mask from eeprom data instead of just setting it
to four tx-rx streams

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-11-20 12:27:21 +01:00
Lorenzo BianconiandFelix Fietkau 81f2be0c45 mt76: mt7615: track tx/rx airtime for airtime fairness
Poll per-station hardware counters available in WTBL after tx/rx
status events in order to report tx/rx airtime to mac80211 layer

Co-developed-by: Felix Fietkau <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-09-26 18:34:32 +02:00
Felix Fietkau d91f7c1bcd mt76: mt7615: fix survey channel busy time
Like on mt7603, MIB status register 16 tracks CCA time, but does not
include tx time. Switch to status register 9 to includ NAV and tx
time as well.

Signed-off-by: Felix Fietkau <[email protected]>
2019-09-26 18:34:32 +02:00
Lorenzo BianconiandFelix Fietkau 028071d959 mt76: mt7615: report tx_time, bss_rx and busy time to mac80211
Report tx time/rx time and obss time from hw mib counters to fill survey
info requested by mac80211

Co-developed-by: Felix Fietkau <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-09-26 18:03:36 +02:00
Lorenzo BianconiandFelix Fietkau 696c0fc551 mt76: mt7615: collect aggregation stats
Introduce ampdu_stat entry in mt7615 debugfs in order to dump 802.11
aggr cumulative statistics

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-09-26 12:04:20 +02:00
Lorenzo BianconiandFelix Fietkau 1118b5ea76 mt76: mt7615: add queue entry in debugfs
Introduce mt7615_queues_read routine to dump hw queue related info.
Add hw ac queues statistics in mt7615 debugfs

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-09-26 12:04:20 +02:00
Felix Fietkau 8739f87e9a mt76: mt7615: fix control frame rx in monitor mode
Adjust filters and ensure frames don't get sent to MCU instead of host

Signed-off-by: Felix Fietkau <[email protected]>
2019-09-12 16:42:54 +02:00
Lorenzo BianconiandFelix Fietkau 9657e63043 mt76: mt7615: enable survey support
Introduce channel survey support for mt7615 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-21 13:02:33 +02:00
Lorenzo BianconiandFelix Fietkau 2becd13be7 mt76: mt7615: add Smart Carrier Sense support
Introduce Smart Carrier Sense support in order to tune device
sensitivity according to RTS error rate and False CCA reported by the
radio

Tested-by: Ryder Lee <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:22:21 +02:00
Lorenzo BianconiandFelix Fietkau e8c95e5a41 mt76: mt7615: introduce mt7615_mac_wtbl_set_key routine
Add mt7615_mac_wtbl_set_key routine to configure wtbl key parameter
directly from host cpu. This is a preliminary patch to add BIP_CMAC_128
hw support. Moreover add static qualifier to mt7615_mac_get_key_info
routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:21:27 +02:00
Felix Fietkau 3d7f7384be mt76: mt7615: add missing register initialization
- initialize CCA signal source
- initialize clock for band 1 (7615D)
- initialize BAR rate

Signed-off-by: Felix Fietkau <[email protected]>
2019-07-16 18:12:43 +02:00
Felix Fietkau 6f9837833b mt76: mt7615: sync with mt7603 rate control changes
- Store the previous and current rate set in the driver + the TSF value
  at the time of the switch.
- Use the tx status TSF value to determine which rate set needs to be used
  as reference.
- Report only short or long GI rates for a single status event, not a mix.
- The hardware reports the last used rate index. Use it along with the
  retry count to figure out what rate was used for the first attempt.
- Use the same retry count value for all rate slots to make this calculation
  work.
- Derive the probe rate from the current rateset instead of the skb cb
- Do not wait for a status report for the probe frame before removing the
  probe rate from the rate table. Do it immediately after it was referenced
  in a tx status report.
- Use the first half of the first rate retry budget for the probe rate
  in order to avoid using too many retries on that rate
- Switch from lower rates to higher rates more conservatively
- enable hardware rate up/down selection

Signed-off-by: Felix Fietkau <[email protected]>
2019-07-03 21:46:34 +02:00
Felix Fietkau 2ae01f7e77 mt76: mt7615: reset rate index/counters on rate table update
These values must be initialized to zero, otherwise the hardware could
reuse previous values, especially the rate index

Signed-off-by: Felix Fietkau <[email protected]>
2019-07-03 21:45:10 +02:00
Ryder LeeandFelix Fietkau 334b4cedf2 mt76: add mac80211 driver for MT7615 PCIe-based chipsets
This driver is for a newer generation of MediaTek MT7615 4x4 802.11ac
PCIe-based chipsets, which support wave2 MU-MIMO up to 4 users/group
and also support up to 160MHz bandwidth.

The driver fully supports AP, station and monitor mode.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Roy Luo <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-04-25 12:04:34 +02:00