Commit Graph
611 Commits
Author SHA1 Message Date
Felix Fietkau 2a32a4a8f8 mt76: check qos ack policy before reordering packets
Do not attempt to reorder packets not part of a BA session

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:37 +01:00
Felix Fietkau bfda6a2984 mt76x2: do not set status->aggr for NULL data frames
Avoids data connection stalls when the client toggles powersave mode

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:37 +01:00
Felix Fietkau 6b70c25c18 mt76: avoid re-queueing A-MPDU rx reorder work if no frames are pending
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:37 +01:00
Felix Fietkau 20777f199b mt76: implement processing of BlockAckReq frames
Avoids timeouts on reordered A-MPDU rx frames

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:37 +01:00
Felix Fietkau afa61bcd61 mt76: implement AP_LINK_PS
With software A-MPDU reordering in place, frames that notify mac80211 of
powersave changes are reordered as well, which can cause connection
stalls. Fix this by implementing powersave state processing in the
driver.

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:36 +01:00
Felix Fietkau c35933bc96 mt7603: fix rx LDPC reporting
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:36 +01:00
Felix Fietkau 2e7332f4b0 mt7603: fix 40 mhz channel bandwidth reporting
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:35:36 +01:00
Felix Fietkau 69c07bce67 mt76: let mac80211 validate CCMP PN for fragmented frames
The rules for those are more complex and performance is not an issue
here

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:34:04 +01:00
Lorenzo BianconiandFelix Fietkau de3a5f1175 mt7603: init: disable tbtt tasklet during device removal
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:34:04 +01:00
Lorenzo BianconiandFelix Fietkau b242e2b109 mt76x2: init: disable all pending tasklets during device removal
There is a possible race in mt76x2_stop_hardware() since pre_tbtt and
dfs tasklets could run during driver cleanup. Fix it disabling all
pending tasklets during device removal

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:34:04 +01:00
Felix Fietkau 2b5ea6f4e7 mt76: validate rx CCMP PN
Apparently hardware does not perform CCMP PN validation in hardware, so
we need to take care of this in the driver.

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:34:03 +01:00
Felix Fietkau bd7f6e167e mt76: pass the per-vif wcid to the core for multicast rx
Preparation for adding software rx CCMP PN validation

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:33:41 +01:00
Felix Fietkau e436824261 mt76: split mt76_rx_complete
Add a separate function for processing frames after A-MPDU reordering,
reduce code duplication

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:33:41 +01:00
Felix Fietkau f0a63aeba0 mt76: implement A-MPDU rx reordering in the driver code
This is required for performing CCMP PN validation in software

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:33:40 +01:00
Felix Fietkau 3a3a799042 mt76: get station pointer by wcid and pass it to mac80211
Avoids the rhashtable lookup based on the MAC address inside mac80211

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:33:11 +01:00
Felix Fietkau 2cda0ad31f mt76: add an intermediate struct for rx status information
Preparation for passing in more internal rx data via skb->cb

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:32:53 +01:00
Felix Fietkau 380a56b74c mt76x2: fix TSF value in probe responses
Like beacons, probe responses need a hardware-generated TSF value. Set
the flag that causes the hw to generate it

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau 8d9cdd96ca mt76: retry rx polling as long as there is budget left
Sending frames to mac80211 needs time, which could allow for more rx
packets to end up in the DMA ring. Retry polling until there are no more
frames left. Improves rx latency under load.

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau 50ca27f230 mt76x2: fix WMM parameter configuration
Fix hw queue configuration since mt76x2 devices use a reverse queue
enumeration respect to mac80211 one:
 - 0: AC_BE
 - 1: AC_BK
 - 2: AC_VI
 - 3: AC_VO

The issue can be reproduced sending two concurrent flow using
two separate queues:
 - VO: 20Mbps UDP traffic
 - BE: TCP traffic

In this scenario the UDP traffic will be blocked by the TCP one.
Fix it configuring properly WMM hw queue parameters

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Tested-by: Gaetano Catalli <[email protected]>
Signed-off-by: Gaetano Catalli <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau e31eea3a6f mt76x2: dfs: take into account dfs region in mt76x2_dfs_init_params()
Do not enable DFS state machine if dfs region is set to NL80211_DFS_UNSET

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau 149295ad97 mt76x2: dfs: add set_domain handler
Add mt76x2_dfs_set_domain routine in order to properly reconfigure
pattern detector when DFS domain has been changed

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau 23355cec21 mt76x2: dfs: avoid tasklet scheduling during mt76x2_dfs_init_params()
Substitute tasklet_kill with tasklet_disable/tasklet_enable in order to
guarantee dfs tasklet can not be executed during dfs parameter
initialization

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Fengguang WuandFelix Fietkau 58dbda75bd mt76: fix returnvar.cocci warnings
drivers/net/wireless/mediatek/mt76/mt76x2_main.c:86:5-8: Unneeded variable: "ret". Return "0" on line 112

 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes: a5f6039c8f9c ("mt76: add driver code for MT76x2e")
CC: Felix Fietkau <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau 808c1c571a mt76x2: add functions for setting extended MAC address registers
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau dd270b09a7 mt7603: mcu: fix potential NULL pointer dereferencing on failed allocation
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau d543b03eac mt7603: main: fix possible NULL pointer dereferencing in mt7603_ampdu_action()
Initialize mt76_txq pointer after ieee80211_txq pointer check.
Remove space after the pointer cast

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau d225fa72b8 mt7603: fix configuration for HT40
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau 9659c8c19c mt76x2: eeprom: fix typo in mt76x2_get_power_info_5g()
Fix typo in 5GHz power vs channel eeprom parsing

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau bf6a341e9a mt76x2: mac: fix possible NULL pointer dereferencing in mt76x2_mac_write_txwi()
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau 0ee431dac9 mt76x2: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Initialize mt76_txq pointer after ieee80211_txq pointer check.
Remove space after the pointer cast

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-30 10:23:03 +01:00
Colin Ian KingandFelix Fietkau 9e1b8edcf3 mt76: fix memcpy to potential null pointer on failed allocation
Currently if the allocation of skb fails and returns NULL then the
call to skb_put will cause a null pointer dereference. Fix this by
checking for a null skb and returning NULL.  Note that calls to
function mt76x2_mcu_msg_alloc don't directly check the null return
but instead pass the NULL pointer to mt76x2_mcu_msg_send which
checks for the NULL and returns ENOMEM in this case.

Detected by CoverityScan, CID#1462624 ("Dereference null return value")

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Colin Ian King <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau 4a11cc1256 mt7603: configure other-unicast drop based on monitor mode setting
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Lorenzo BianconiandFelix Fietkau a3323a115a mt76x2: init: fix rx filter default value during init
mt76x2_mac_start writes dev->rxfilter to the hardware. It also happens
during init, before dev->rxfilter is filled with the initval register
value, leading to issues like promisc mode being enabled
unconditionally.

Fix this by reading the default value into dev->rxfilter earlier

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau a3dbfdbc8c mt76x2: configure rx filter based on monitor mode setting
Due to an unrelated issue, the MT_RX_FILTR_CFG_PROMISC flag is currently
unset, which means that monitor mode is unconditionally enabled.
Toggle this flag based on the mac80211 monitor mode setting instead

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau 91cc0d4734 Partially revert "mt7603: use mcu command to set timing registers, fix OFDM timeout values"
This reverts commit 268467b9a4.
It is unnecessary to go through the MCU for this.

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau af68a59c5f mt7603: update firmware to version 20160107100755
Signed-off-by: Felix Fietkau <[email protected]>
2018-01-30 10:23:03 +01:00
Felix Fietkau e326bc2ac4 mt7603: remove some harmless WARN_ONs in rx path
Discard affected packets instead. Should reduce the frequency of bogus
bug reports

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 86ddef3b21 mt76x2: remove some harmless WARN_ONs in tx status and rx path
Discard affected packets instead. Should reduce the frequency of bogus
bug reports

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 7dd2a9e771 mt7603: initialize wtbl ps flag on station add
Ensure that the firmware hasn't changed anything

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 123acf2461 mt7603: set tx-skip flag for powersave clients
Helps flush out frames faster

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau dc7a351279 mt7603: clear wtbl PS bit for powersave responses
Avoids filtering frames that are supposed to be sent

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 41e6a04837 mt7603: make mt7603_mac_watchdog_reset() static
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 7dc8db1362 mt7603: clean up dma debug reads
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 4ed7e07cd8 mt7603: warn if PSE reset fails
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
Felix Fietkau 30750599f0 mt7603: simplify PSE reset
Skip PSE client reset, it is done by the firmware already

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 21:45:43 +01:00
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