Commit Graph
598 Commits
Author SHA1 Message Date
Fengguang WuandFelix Fietkau 2b7fae40d6 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-18 19:04:21 +01:00
Felix Fietkau 68b0cf17ef mt76x2: add functions for setting extended MAC address registers
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-17 11:50:14 +01:00
Felix Fietkau d242650960 Revert "mt76x2: remove MAC address limitation for multi-vif setups"
This reverts commit 170f3341c6.
2017-12-17 11:44:47 +01:00
Felix Fietkau bdc6f2f970 Revert "mt76x2: clean up MAC/BSSID address initialization"
This reverts commit 3563b8fd0a.
2017-12-17 11:44:27 +01:00
Felix Fietkau bcd576e710 Revert "mt76x2: drop wiphy->addresses"
This reverts commit 9de77e1efc.
2017-12-17 11:44:11 +01:00
Felix Fietkau 860b185a43 Revert "mt76x2: init: disable APCLI by default"
This reverts commit a6a6e2582a.
2017-12-17 11:43:51 +01:00
Lorenzo BianconiandFelix Fietkau bf90dd27eb mt7603: mcu: fix potential NULL pointer dereferencing on failed allocation
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-12-15 15:31:01 +01:00
Lorenzo BianconiandFelix Fietkau 31e9bdb1af 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]>
2017-12-15 15:30:53 +01:00
Felix Fietkau 00f7e60e98 mt7603: fix configuration for HT40
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-14 17:59:37 +01:00
Lorenzo BianconiandFelix Fietkau 4ca8bba267 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]>
2017-12-14 16:42:01 +01:00
Lorenzo BianconiandFelix Fietkau 2d4b8f57cc mt76x2: mac: fix possible NULL pointer dereferencing in mt76x2_mac_write_txwi()
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-12-14 16:42:01 +01:00
Lorenzo BianconiandFelix Fietkau ca5ca8c779 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]>
2017-12-14 16:41:52 +01:00
Colin Ian KingandFelix Fietkau cf4a5ce03d 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]>
2017-12-14 11:18:53 +01:00
Felix Fietkau e504656052 mt7603: configure other-unicast drop based on monitor mode setting
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-08 13:29:19 +01:00
Lorenzo BianconiandFelix Fietkau ac815fa2a5 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]>
2017-12-08 12:11:04 +01:00
Felix Fietkau c64633e857 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]>
2017-12-08 11:55:29 +01:00
Lorenzo BianconiandFelix Fietkau a6a6e2582a mt76x2: init: disable APCLI by default
It is no longer necessary for client mode operation, vif index entries
8-16 are no longer used

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 21:18:55 +01:00
Felix Fietkau 9de77e1efc mt76x2: drop wiphy->addresses
Now that the MAC address limitation is resolved, we no longer need a MAC
address list

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 19:51:01 +01:00
Felix Fietkau 3563b8fd0a mt76x2: clean up MAC/BSSID address initialization
Drop the use of the EEPROM address entirely, rely on interface address
only

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 19:51:01 +01:00
Felix Fietkau 170f3341c6 mt76x2: remove MAC address limitation for multi-vif setups
The hardware has a separate set of registers to configure a
per-interface MAC address.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 19:50:46 +01:00
Felix Fietkau 4d4cd05966 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]>
2017-12-07 17:09:28 +01:00
Felix Fietkau d02a05b0b3 mt7603: update firmware to version 20160107100755
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 22:30:14 +01:00
Felix Fietkau 8e17d36381 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 18:15:05 +01:00
Felix Fietkau b4034cf325 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 18:14:12 +01:00
Felix Fietkau c8e5ab19ea 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 17:32:34 +01:00
Felix Fietkau 57a2e334ec mt7603: set tx-skip flag for powersave clients
Helps flush out frames faster

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 17:32:34 +01:00
Felix Fietkau e953c78806 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 16:49:02 +01:00
Felix Fietkau 96817d63ea mt7603: make mt7603_mac_watchdog_reset() static
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-03 16:49:02 +01:00
Felix Fietkau c079960b59 mt7603: clean up dma debug reads
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-02 11:11:58 +01:00
Felix Fietkau d8a59901ec mt7603: warn if PSE reset fails
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-02 10:50:08 +01:00
Felix Fietkau c8807b4a3c mt7603: simplify PSE reset
Skip PSE client reset, it is done by the firmware already

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-02 10:49:14 +01:00
Felix Fietkau d99092baab 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-02 10:43:39 +01:00
Felix Fietkau c4dd32abb5 mt7603: remove watchdog reset on interface stop
It can be harmful in some cases

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-01 17:51:44 +01:00
Felix Fietkau 8026638543 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-01 17:50:59 +01:00
Felix Fietkau 737cf2b6f7 mt7603: rename mt7603_mac_reset to mt7603_pse_reset
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-01 17:38:39 +01:00
Felix Fietkau 19fff41338 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-11-30 12:59:31 +01:00
Felix Fietkau 3bd7e76e2d mt76x2: initialize channel power limits
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-30 12:33:47 +01:00
Felix Fietkau 11f42a8aab mt76x2: add channel argument to eeprom tx power functions
Preparation for exposing maximum power to mac80211

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-30 12:16:39 +01:00
Felix Fietkau a51358e3ae mt76x2: increase OFDM SIFS time
Fixes throughput issues in combination with LDPC

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-29 13:14:45 +01:00
Felix Fietkau 792859b237 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-11-29 12:18:34 +01:00
Felix Fietkau a4c82cad00 mt7603: add missing include required on newer kernels
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-29 10:07:24 +01:00
Felix Fietkau fc28872399 mac80211: add missing include
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-21 09:48:19 +01:00
Felix Fietkau 8f1c8abdf7 mt76x2: sync tx power related values with reference driver
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 19:48:52 +01:00
Felix Fietkau 70f2002651 mt76x2: add more gain tuning based on the latest reference driver
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 19:25:33 +01:00
Felix Fietkau 4af37bd999 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 19:12:01 +01:00
Felix Fietkau efd7724b1a mt76x2: sync channel gain value with latest reference driver
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 18:31:06 +01:00
Felix Fietkau af425def8c mt76x2: fix LNA gain register annotation
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 18:09:43 +01:00
Felix Fietkau b57ada5d54 mt76x2: add rx statistics registers
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 17:47:18 +01:00
Felix Fietkau ff60d1482c mt76: increase rx ring size for mt76x2
Should improve performance under load

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-16 16:26:45 +01:00
Felix Fietkau ccc4baf446 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 14:14:08 +01:00