Commit Graph
100 Commits
Author SHA1 Message Date
Felix Fietkau 59f7bb6fbf Revert "mt76: mt76x02: send no-skb tx status without holding the status lock"
This reverts commit 4d8c7e8284.
To be replaced by upstream fix

Signed-off-by: Felix Fietkau <[email protected]>
2019-04-29 17:20:50 +02:00
Felix Fietkau 98c5359e96 Revert "mt76: fix potential deadlock on cancelling workqueues"
This reverts commit 3a7e6bbac3
to be replaced by upstream patch.

Signed-off-by: Felix Fietkau <[email protected]>
2019-04-29 13:37:40 +02:00
Felix Fietkau e9eea39237 mt76: mt7615: use sizeof instead of sizeof_field
It is simpler in this case

Signed-off-by: Felix Fietkau <[email protected]>
2019-04-25 12:04:34 +02:00
Felix Fietkau b3a29655ae mt76x02: fix crash on device reset
Tasklets must not be reinitialized after being scheduled

Signed-off-by: Felix Fietkau <[email protected]>
2019-04-03 11:12:31 +02:00
Felix Fietkau a11b67348a mt76: fix tx power issues
- tx power is stored in the channels after ieee80211_register_hw, so
  chan->orig_mpwr needs to be updated as well
- for non-TSSI devices, mt76x2e needs to use a different target power value
  from the EEPROM
- fix a rounding error in a few places (need to round up, not down)

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-27 12:54:48 +01:00
Felix Fietkau bf6e72d6df Revert "mt76: mt76x02: store software PN/IV in wcid"
This reverts commit f37ad72f1a.
PN needs to be shared with mac82011 for mgmt frame crypto

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-26 11:35:22 +01:00
Felix Fietkau ae166b09cf Revert "mt76: mt7603: store software PN/IV in wcid"
This reverts commit 2660aa98c4.
PN needs to be shared with mac82011 for mgmt frame crypto

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-26 11:35:18 +01:00
Felix Fietkau 30a256a438 mt76x02: remove extra_tx_headroom (obsoleted by mac8211 skb aligning)
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-25 09:30:05 +01:00
Felix Fietkau 6fc50ea917 mt7603: send BAR after powersave wakeup
Now that the sequence number allocation is fixed, we can finally send a BAR
at powersave wakeup time to refresh the receiver side reorder window

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-23 18:01:28 +01:00
Felix Fietkau 5912e8a1ff mt7603: fix sequence number assignment
If the MT_TXD3_SN_VALID flag is not set in the tx descriptor, the hardware
assigns the sequence number. However, the rest of the code assumes that the
sequence number specified in the 802.11 header gets transmitted.
This was causing issues with the aggregation setup, which worked for the
initial one (where the sequence numbers were still close), but not for
further teardown/re-establishing of sessions.

Additionally, the overwrite of the TID sequence number in WTBL2 was resetting
the hardware assigned sequence numbers, causing them to drift further apart.

Fix this by using the software assigned sequence numbers

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-23 17:58:06 +01:00
Felix Fietkau 60e508ed14 mt76: use readl/writel instead of ioread32/iowrite32
readl/writel is faster because it gets rid of unnecessary extra checks

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-23 15:24:58 +01:00
Felix Fietkau c9402eb0f0 mt76: use napi polling for tx cleanup
This allows tx scheduling and tx cleanup to run concurrently

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-22 14:05:08 +01:00
Felix Fietkau deacb8fa8a mt76: fix using mac80211 tx skb header padding
If the 802.11 frame has no payload, skip the padding.
Also add missing code to mt76x02u

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-22 14:02:57 +01:00
Felix Fietkau 3a7e6bbac3 mt76: fix potential deadlock on cancelling workqueues
mutex->lock must not be held while cancelling workqueues, because it is held
by the workqueue items themselves

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-22 13:29:47 +01:00
Felix Fietkau 7e9e9ad734 mt76: mt7603: add missing initialization for dev->ps_lock
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-22 13:29:47 +01:00
Felix Fietkau 4d8c7e8284 mt76: mt76x02: send no-skb tx status without holding the status lock
Simplifies locking and reduces lock contention

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-22 13:29:47 +01:00
Felix Fietkau e7bd802cf7 mt76: adjust for mac80211 txq scheduling API changes
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-19 10:09:15 +01:00
Felix Fietkau 2660aa98c4 mt76: mt7603: store software PN/IV in wcid
Avoids expensive 64-bit atomic access in the data path

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-16 20:11:42 +01:00
Felix Fietkau 42ce040662 mt76: use TX_NEEDS_ALIGNED4_SKBS
Remove custom header padding insert code

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-15 11:27:33 +01:00
Felix Fietkau 688d708a43 mt76: only schedule txqs from the tx tasklet
Reduces lock contention from the tx path and improves performance

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-14 22:37:30 +01:00
Felix Fietkau 5323005150 mt76: move tx tasklet to struct mt76_dev
Allows it to be scheduled from core code

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-14 22:37:30 +01:00
Felix Fietkau f37ad72f1a mt76: mt76x02: store software PN/IV in wcid
Avoids expensive 64-bit atomic access in the data path

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-14 22:37:30 +01:00
Felix Fietkau c0ab515474 mt76: store wcid tx rate info in one u32 reduce locking
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-14 22:37:30 +01:00
Felix Fietkau b77b9323c6 mt76: reduce locking in mt76_dma_tx_cleanup
q->tail can be safely updated without locking, because there is no
concurrent access. If called from outside of the tasklet (for flushing),
the tasklet is always disabled.
q->queued can be safely read without locking, as long as the decrement
happens within the locked section.
This patch allows cleaning up tx packets outside of the section that holds
the queue lock for improved performance

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-14 22:37:30 +01:00
Felix Fietkau 72fe286f2d mt76: use mac80211 txq scheduling
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-14 22:37:30 +01:00
Felix Fietkau 312f6fc6f6 mt76: remove irqsave/restore in locking for tx status fifo
Use a separate lock and spin_trylock to avoid disabling interrupts.
Should improve performance and latency

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-13 12:53:23 +01:00
Felix Fietkau 320af65ca1 mt76: mt7603: use the correct hweight8() function
__sw_hweight8() is only defined if CONFIG_GENERIC_HWEIGHT is enabled.
The function that works on all architectures is hweight8().

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-11 14:09:05 +01:00
Felix Fietkau 00ac79d1af mt7603: fix initialization of max rx length
The previous version only accidentally disabled A-MSDU deaggregation by
using the wrong mask for rx length configuration, which left previous
length value in place.
Fix the length and initialize the register completely to keep A-MSDU
de-aggregation remaining disabled

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-08 19:51:42 +01:00
Felix Fietkau 1d7760d904 mt76: mt7603: set moredata flag when queueing ps-filtered packets
Clients should poll for more packets afterwards

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-04 08:37:34 +01:00
Felix Fietkau 461f3b0930 mt76: mt76x02: disable ED/CCA by default
This feature has been reported to cause stability issues on several systems.
Disable it until it has been fixed and verified. It can still be enabled
through debugfs

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 19:40:38 +01:00
Felix Fietkau 42ab27e54a mt76: when releasing PS frames, end the service period if no frame was found
Fixes a rare corner case if the txq dequeue attempt fails, but mac80211
still has PS buffered packets

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 19:21:42 +01:00
Felix Fietkau 3687eec55f mt76: mt7603: clear the service period on releasing PS filtered packets
These packets have no txwi entry in the ring, so tracking via tx status does
not work. To prevent PS poll requests from being unanswered, end the service
period right away

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 19:21:42 +01:00
Felix Fietkau eb1ecc402f mt76: mt7603: notify mac80211 about buffered frames in ps queue
Also fix the size check for filtered powersave frames
Fixes a corner case with waking up clients

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 19:21:42 +01:00
Felix Fietkau d13b065957 mt76: mt7603: fix up hardware queue index for PS filtered packets
Make the queue index match the hardware queue on which they get sent out

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 19:21:42 +01:00
Felix Fietkau 8bfe6d44ae mt76: mt7603: clear ps filtering mode before releasing buffered frames
Fixes sending them, otherwise they loop back right into the buffer

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 19:21:42 +01:00
Felix Fietkau 8ee225996f mt76: mt76x2: fix 2.4 GHz channel gain settings
AGC register 35, 37 override for the low gain setting should only be done
on 5 GHz. Also, 2.4 GHz needs a different value for register 35

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 15:12:19 +01:00
Felix Fietkau d2c682325d mt76: mt76x2: fix external LNA gain settings
Devices with external LNA need different values for AGC registers 8 and 9

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 15:10:44 +01:00
Felix Fietkau 2ed938271c mt76: mt7603: fix tx status HT rate validation
Use the correct variable in the check. Fixes an uninitialized variable warning

Reported-by: Gustavo A. R. Silva <[email protected]>
Fixes: c8846e1015022 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-03 11:06:20 +01:00
Felix Fietkau 669bc492f2 mt76: mt76x02: reduce false positives in ED/CCA tx blocking
Full tx blocking (as opposed to CCA blocking) should only happen if there
is a continuous non-802.11 signal above the energy detect threshold.
Unfortunately the ED/CCA counter can't detect that, as it also counts 802.11
signals as busy.

Similar to the vendor code, implement a learning mode that waits until the AGC
gain has already been adjusted to the lowest value (due to false CCA events),
and the number of false CCA events still remains high, and the blocking
threshold is exceeded for more than 5 seconds.

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-02 18:23:23 +01:00
Felix Fietkau 6b10cfcdd4 mt76: mt76x02: only update the base mac address if necessary
Also update the mask first before calculating the vif index.
Fixes an issue where adding back the same interfaces in a different order
fails because of duplicate vif index use

Fixes: 06662264ce2ad ("mt76x02: use mask for vifs")
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-01 16:52:39 +01:00
Felix Fietkau 2c62d03d69 mt76x02: clear running flag when resetting state on restart
Use it to avoid unsafe calls to mt76_wake_tx_queue

Signed-off-by: Felix Fietkau <[email protected]>
2019-03-01 14:51:48 +01:00
Felix Fietkau 8b437d26a9 mt76x02: clear sta and vif driver data structures on add
Signed-off-by: Felix Fietkau <[email protected]>
2019-03-01 13:02:45 +01:00
Felix Fietkau ead881b550 mt76: mt76x02: do not sync PN for keys with sw_iv set
The hardware PN value is invalid in that case

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-28 17:44:12 +01:00
Felix Fietkau fa8340696f mt76: mt76x2: implement full device restart on watchdog reset
Restart the firmware and re-initialize the MAC to be able to recover
from more kinds of hang states

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-27 19:42:41 +01:00
Felix Fietkau 30e757eb29 mt76: mt76x02: when setting a key, use PN from mac80211
Preparation for full device restart support

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-27 19:40:30 +01:00
Felix Fietkau 3c6df9b75c mt76: rewrite dma descriptor base and ring size on queue reset
Useful in case the hardware reset clobbers these values

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-27 19:38:30 +01:00
Felix Fietkau fd315bd0f2 mt7603: disable dynamic sensitivity adjustment by default
The vendor driver also does not enable it, and it has been shown to cause
some issues. It can be re-enabled for testing through debugfs

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-26 15:15:54 +01:00
Felix Fietkau 18af219438 mt76: mt76x02: set MT_TXOP_HLDR_TX40M_BLK_EN for mt76x2
It needs to be always enabled for 76x2 and conditionally enabled/disabled
for 76x0. Since mt76x2_mac_stop clears this bit, ensure that it is enabled
in mt76x02_edcca_init

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-25 18:37:43 +01:00
Felix Fietkau 5e7ecce133 mt76: mt76x2: unify mt76x2[u]_mac_resume
They are now the same and short enough to be turned into an inline function

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-25 17:32:46 +01:00
Felix Fietkau 52161d2e86 mt76: mt76x02: fix ED/CCA enabling/disabling
ED/CCA needs to be disable before stopping the MAC to avoid hangs from tx
being blocked. It must only be enabled again after the MAC has been started
again.
In many places this wasn't done properly, so fix this by always clearing
the relevant ED/CCA bits in mt76x2_mac_stop and set it up again after
channel change or calibration is done

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-25 17:29:20 +01:00
Felix Fietkau 8c8eb9835b mt76: mt76x02: issue watchdog reset on MCU request timeout
MCU request timeout usually indicates that the device is no longer responsive,
and it usually does not recover without a reset

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-24 23:19:38 +01:00
Felix Fietkau 59a6587040 mt76: mt76x02: only reset beacon drift counter when enabling beacons
When the timer is already running, there is no need to reset the counter,
because the drift will remain the same.

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-24 13:03:21 +01:00
Felix Fietkau 43d2507914 mt76: mt76x02: fix beacon timer issue
When mt76x0 and mt76x2 beacon code was unified, it changed the order in which
beacon enable and beacon interval are configured.
Configuring beacon enable before beacon interval can in some cases cause
problems with the beacon timer, leading to clients not waking up properly
from powersave mode.
Fix this by changing the order back to interval first, then enable.

Fixes: cc726268e4dce ("mt76: move mt76x02_bss_info_changed in mt76x02-lib module")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-24 11:37:19 +01:00
Felix Fietkau 783da04c1f mt76: mt76x02: fix beacon timer drift adjustment
Check the count before incrementing it to match vendor code behavior.
This defers the adjustment by one more tick, which should improve accuracy

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-24 11:28:30 +01:00
Felix Fietkau 6231336f18 mt76: mt76x02: fix TSF sync mode
MT_BEACON_TIME_CFG_SYNC_MODE needs to be set for AP mode, according to the
documentation. For other modes it should be irrelevant in this case.

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-23 20:05:05 +01:00
Felix Fietkau 74075efe44 mt76: increase ED/CCA tx block threshold
Block only when the busy time reaches 92%, as lower values can be reached with
heavy 802.11 traffic as well.

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 20:37:47 +01:00
Felix Fietkau e301f2349a mt76: measure the time between mt76x02_edcca_check runs
Based on system load and time needed by other calibration runs, the time
between dev->mac_work runs can vary quite a bit.
Calculate busy time based on the actual time difference in order to avoid
potentially over-estimating busy time, which could lead to unnecessary tx
blocking.

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 14:46:59 +01:00
Felix Fietkau 4e8766a59c mt76: clear CCA timer stats in mt76x02_edcca_init
Avoid triggering too early

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 14:46:59 +01:00
Felix Fietkau e3c1aad159 mt76: run MAC work every 100ms
ED/CCA Tx blocking checks need to be run every 100 ms in order to avoid
triggering too late and keeping tx blocking on for too long

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 14:46:51 +01:00
Felix Fietkau 4d7e13fcd5 mt76: explicitly disable energy detect cca during scan
Avoid reusing the previous channel's tx blocking state

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 13:59:32 +01:00
Felix Fietkau a9d4c0ea0d mt76: mt76x2: avoid running DPD calibration if tx is blocked
Doing so could lead to hangs

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 13:52:14 +01:00
Felix Fietkau 2afa0d7e7a mt7603: remove WCID override for software encrypted frames
It is not necessary, since the hardware has a flag to indicate hardware
encryption offload

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 21:51:29 +01:00
Felix Fietkau e747e804c9 mt76: fix software encryption issues
Software encrypted packets can be passed not just through the drv_tx callback,
but also through the intermediate tx queue.
In order to deal with that, move the override to mt76x02_mac_write_txwi and
also take care of filling in the per-packet rate information

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 21:13:39 +01:00
Felix Fietkau 8027b5d061 mt7603: remove copyright headers
No longer needed because of SPDX License Identifier

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 18:30:30 +01:00
Felix Fietkau a4ec45c294 mt7603: fix LED support (copy CFLAGS from main Makefile)
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:35:33 +01:00
Felix Fietkau b5ac8e49c5 mt7603: initialize LED callbacks only if CONFIG_MT76_LEDS is set
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 15:03:25 +01:00
Felix Fietkau 0db925f076 mt7603: update HT/VHT capabilities after assoc
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 12:18:32 +01:00
Felix Fietkau ae30c30f33 mt76: add driver callback for when a sta is associated
MT7603 needs this to update the HT/VHT capabilities

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 12:17:23 +01:00
Felix Fietkau 6eef33bfd5 mt7603: remove mt7603_txq_init
Simplify the code by open coding it in the only remaining caller

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 12:10:45 +01:00
Felix Fietkau 7a53138b32 mt7603: trigger watchdog reset if flushing CAB queue fails
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-29 16:20:15 +01:00
Felix Fietkau c3da1aa3b0 mt7603: trigger beacon stuck detection faster
Check against number of active beacon interfaces instead of maximum number
of interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-29 16:18:19 +01:00
Felix Fietkau 0b939dc7ed mt76: fix resetting software IV flag on key delete
It needs to be unset instead of set

Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 18:02:04 +01:00
Felix Fietkau 64abb35d2b mt76: fix corrupted software generated tx CCMP PN
Since ccmp_pn is u8 *, the second half needs to start at array index 4
instead of 0. Fixes a connection stall after a certain amount of traffic

Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 18:01:55 +01:00
Felix Fietkau 7d00d58f74 mt76x02: fix per-chain signal strength reporting
Set the per-chain signal value for chain 0 and simplify the code
(no need for a loop for just one extra chain)

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 15:26:13 +01:00
Felix Fietkau b4ee01f95c mt76: fix tx status timeout processing
Remove bogus check for MT_PACKET_ID_NO_ACK in mt76_tx_status_skb_get, which
is already handled in callers and turns timeout calls into no-ops
Do not clean up pending status items on reordering of tx status information
if the timeout is not reached yet

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 15:22:41 +01:00
Felix Fietkau aa470d8655 mt7603: fix buffered multicast queue flush
For some reason the BMC queue flush does not work properly if packets were
queued for a BSS0_n interface (secondary vif).
Work around this issue by using the DMA scheduler to filter the queue before
issueing the BMC queue flush.

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 15:25:16 +01:00
Felix Fietkau e342cc5c72 mt7603: fix buffered multicast count register
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 14:24:43 +01:00
Felix Fietkau ce8cc5d52d mt7603: issue PSE client reset on init
Improves reliability of module reload after tx hangs

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 14:09:54 +01:00
Felix Fietkau fe30bd35e2 mt7603: issue PSE reset on tx hang
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 14:03:31 +01:00
Felix Fietkau 2efa389b4c mt7603: limit station power save queue length to 64
Avoid excessive memory use, in case something goes wrong.

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 21:02:33 +01:00
Felix Fietkau 1c751f391f mt76: avoid scheduling tx queues for powersave stations
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 17:33:38 +01:00
Felix Fietkau 3df341d597 mt7603: avoid redundant MAC timing updates
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 15:04:37 +01:00
Felix Fietkau 79b337cfad mt7603: move CF-End rate update to mt7603_mac_set_timing
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 15:03:19 +01:00
Felix Fietkau b35cc8eefa mt7603: set timing on channel change before starting MAC
MAC needs to be stopped/started for timing change anyway

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 14:59:52 +01:00
Felix Fietkau 815fd03e0f mt7603: fix CCA timing values
Sync CCK values with reference driver.
Use OFDM values obtained from the hardware reset value
Stop tx/rx on change only using the ARB_SCR register

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 14:59:52 +01:00
Felix Fietkau 3e9a7d5c4d Revert "mt7603: fix txd q_idx field value"
This reverts commit 4bcb2f9fe2.
This causes a slight throughput regression

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 14:30:47 +01:00
Felix Fietkau fc31457cd9 mt7603: implement support for SMPS
The hardware needs to be notified of peers using dynamic SMPS mode
Fixes using dual-stream rates on some clients (e.g. Intel)

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-20 17:46:51 +01:00
Felix Fietkau 158529d679 mt7603: fix PSE reset retry sequence
Clear pending PSE request bit in order to avoid having it trigger by the
firmware at a bad point in time.
Only clear AC queue stuck bits if the PSE reset succeeded

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-20 15:15:13 +01:00
Felix Fietkau 702f557c75 mt7603: use maximum tx count for buffered multicast packets
Should improve stability

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-20 14:41:39 +01:00
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 4206db7157 mt76: set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR flag
The hardware does not deal with multiple WCID entries for the same station
properly. Set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR to avoid those cases

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-16 22:33:23 +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 d77c861208 mt76: fix rssi ewma tracking
The generic EWMA code cannot deal with negative numbers, so convert signal
to a positive number before adding it
Fixes mt76x2 AGC tuning

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-11 15:24:32 +01:00
Felix Fietkau 2ad54b2f25 mt76: move wcid rssi ewma init to mt76 core
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-11 15:24:32 +01:00
Felix Fietkau 8167074dab Revert "mt7603: update firmware to 20161027164355"
This reverts commit f2ba65f73f
This firmware update has been reported to cause regressions on some devices

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-11 15:24:32 +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