Commit Graph
40 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau 51cff39d7a mt76: overwrite default reg_ops if necessary
Introduce mt76_register_debugfs_fops routine in order to
define per-driver regs file operations and make sure the
device is up before reading or writing its registers

Fixes: 1d8efc741df8 'mt76: mt7921: introduce Runtime PM support'
Fixes: de5ff3c9d1a2 'mt76: mt7615: introduce pm_power_save delayed work'
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-08-13 12:54:37 +02:00
Lorenzo BianconiandFelix Fietkau ef44ff116e mt76: mt7663s: enable runtime-pm
Allow the user to enable runtime-pm for mt7663s driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-18 17:19:44 +02:00
Ryder LeeandFelix Fietkau 41cf021846 mt76: mt7615: add thermal sensor device support
Similar to mt7915, switching to use standard hwmon sysfs.
For reading temperature, cat /sys/class/ieee80211/phy*/hwmon*/temp1_input

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-28 10:14:15 +02:00
Lorenzo BianconiandFelix Fietkau 2ae25c7e54 mt76: mt7663: add awake and doze time accounting
Similar to mt7921, introduce awake and doze time accounting
for runtime pm.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21 14:30:19 +02:00
Ryder LeeandFelix Fietkau ee29cd5f3a mt76: mt7615: only enable DFS test knobs for mt7615
DFS knobs should not be visible to non-DFS devices.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Lorenzo BianconiandFelix Fietkau 47eb00e134 mt76: mt7663: introduce coredump support
Similar to mt7921 devices, introduce coredump support for mt7663 chipset

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-29 18:18:44 +01:00
Lorenzo BianconiandFelix Fietkau 2e217fb9e9 mt76: move tx hw data queues in mt76_phy
Move hw data queues in mt76_phy from mt76_dev since mt7915 supports per
phy hw queues in dbdc mode

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-12 14:59:29 +01:00
Lorenzo BianconiandFelix Fietkau ccd62467d0 mt76: move mcu queues to mt76_dev q_mcu array
Move mcu queue to a dedicated array q_mcu in mt76_dev structure.
This is a preliminary patch to move data queues in mt76_phy and properly
support dbdc

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-12 14:59:29 +01:00
Lorenzo BianconiandFelix Fietkau b0eb7edcc6 mt76: rely on mt76_queue in tx_queue_skb_raw signature
This is a preliminary patch to move data queues in mt76_phy and properly
support dbdc

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-12 14:59:29 +01:00
Felix Fietkau 4d019c9672 sync with upstream changes
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-23 11:38:05 +02:00
Lorenzo BianconiandFelix Fietkau 9a203fea35 mt76: mt7615: introduce quota debugfs node for mt7663s
Add sched_quota debugfs node for mt7663s. Scheduling quota stats
are useful for debugging

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:48:36 +02:00
Lorenzo BianconiandFelix Fietkau 633ae5961d mt76: mt7615: enable beacon filtering by default for offload fw
In order to reduce cpu cycles, enable hw beacon filter by default if
the device is running offload fw with sta only interfaces.
Disable runtime pm for multi-vif scenario.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:48:36 +02:00
Felix Fietkau 7f53d68b1a mt76: mt7615: add debugfs knob for setting extended local mac addresses
This is primarily for testing and can be used in combination with monitor
mode to make the card respond to packets sent to a specific MAC address.
For now this is only exposed as a debug/testing feature, later on the
approach might be used to support more concurrent station interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-25 15:58:32 +02:00
Qinglang MiaoandFelix Fietkau 1449e602fa mt76: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Qinglang Miao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-09-23 08:16:55 +02:00
Felix Fietkau 3218b914a2 mt76: remove struct mt76_sw_queue
All members except for the struct mt76_queue pointer have been removed

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Lorenzo BianconiandFelix Fietkau 7c5445dec8 mt76: mt7615: release mutex in mt7615_reset_test_set
Reduce scope of mutex_acquire/mutex_release in mt7615_reset_test_set
routine in order to fix the following static checker warning:

drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179
mt7615_reset_test_set()
warn: inconsistent returns 'dev->mt76.mutex'.

Reported-by: Dan Carpenter <[email protected]>
Fixes: ea4906c4be49 ("mt76: mt7615: wake device before accessing regmap in debugfs")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 21:19:24 +02:00
Lorenzo BianconiandFelix Fietkau 29f2bebe1a mt76: mt7615: add idle-timeout knob in mt7615 debugfs
Introduce idle-timeout knob in mt7615 debugfs in order to configure the
idle time to switch to low-power state

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-10 14:45:30 +02:00
Lorenzo BianconiandFelix Fietkau 94519eac69 mt76: mt7615: add runtime-pm knob in mt7615 debugfs
Introduce runtime-pm knob in mt7615 debugfs in order to enable/disable
runtime pm available in offload firmware

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-10 14:45:30 +02:00
Lorenzo BianconiandFelix Fietkau e3850966d7 mt76: mt7615: wake device before accessing regmap in debugfs
Make sure the device is in full-power before reading regs in debugfs

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-10 14:45:29 +02:00
Felix Fietkau 46bc8a0b53 mt76: mt7615: add support for accessing RF registers via MCU
Includes debugfs files for testing it.
Will be used for testmode support.

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00
Lorenzo BianconiandFelix Fietkau 43febd4521 mt76: mt7615: fix lmac queue debugsfs entry
acs and wmm index are swapped in mt7615_queues_acq respect to the hw
design

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-07 17:01:19 +02:00
Lorenzo BianconiandFelix Fietkau 722d1f47d8 mt76: add rx queues info to mt76 debugfs
Introduce rx-queues debugfs node in order to dump rx queues status.
This would be useful for mcu fw debugging

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-22 18:02:07 +02:00
Lorenzo BianconiandFelix Fietkau d4e6e225bc mt76: mt7615: move core shared code in mt7615-common module
Create mt7615-common module in order to collect shared code between usb
and mmio code. Move the following source files in mt7615-common module:
- main.c
- init.c
- mcu.c
- mac.c
- debugfs.c
- eeprom.c
- trace.c

Create the following source files for mmio only source code and move them
in mt7615e module:
- pci_init.c
- dma.c
- pci_mac.c

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-17 14:46:00 +02:00
Lorenzo BianconiandFelix Fietkau 25d812dddc mt76: mt7663: fix aggr range entry in debugfs
Fix register definitions for aggr range counter registers for mt7663
chipset

Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-08 17:59:38 +02:00
Lorenzo BianconiandFelix Fietkau d2d7bf2243 mt76: mt7615: make scs configurable per phy
Make scs configurable per phy since most of the chipsets do not
support dbdc

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Ryder LeeandFelix Fietkau 072b50c61e mt76: mt7615: add more useful Tx mib counters
Add ba_miss_cnt and ampdu_per in mib_stats.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Ryder LeeandFelix Fietkau 8bd26d6c31 mt76: mt7615: enable aggr_stats for both phy
Use bottom half of aggr_stats for second phy.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Ryder LeeandFelix Fietkau 9d555f82d3 mt76: mt7615: modify mt7615_ampdu_stat_read for each phy
This is a preliminary patch to add more Tx counters.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Lorenzo BianconiandFelix Fietkau e226309c4b mt76: mt7615: rely on mt76_queues_read for mt7622
As previous devices, mt7622 relies on multiple hw queues while for
mt7615 we have just on per band hw queue and the mcu demux the traffic
according to the packet AC. In order to dump all configured hw queues,
rely on mt76_queues_read for mt7622 in mt7615 debugfs

Signed-off-by: Lorenzo Bianconi <[email protected]>
2020-02-14 10:16:16 +01:00
Felix Fietkau db97358df4 mt76: mt7615: add support for testing hardware reset
Send an undersized corrupt packet to the DMA queue, which causes the
firmware to issue a full chip reset

Signed-off-by: Felix Fietkau <[email protected]>
2020-01-31 16:37:02 +01:00
Felix Fietkau 8f33a1e936 mt76: mt7615: report firmware log event messages
Useful for debugging firmware issues. Can be turned on via the "fw_debug"
debugfs file

Signed-off-by: Felix Fietkau <[email protected]>
2020-01-13 22:17:00 +01:00
Felix Fietkau ea41ad8bdb mt76: mt7615: defer mcu initialization via workqueue
Loading the mcu firmware and waiting for it to boot takes a long time,
which adds a significant amount to the system boot time.
Fix this by running the mcu init from a workqueue and waiting for it to
complete before starting the phy or issuing mcu commands via debugfs

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-05 11:36:53 +01:00
Felix Fietkau 993683d62f mt76: mt7615: add support for registering a second wiphy via debugfs
This is only used for testing for now. In the future it will be possible to
enable the second PHY through an proper API via device tree

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
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
Lorenzo BianconiandFelix Fietkau c7f82146ef mt76: mt7615: add support to read temperature from mcu
Introduce debugfs entry to read device temperature and related cmu
command. Introduce mt7615_mcu_parse_response to parse mcu response
messages and refactor mt7615_mcu_msg_send routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-09-05 17:51:19 +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
Ryder LeeandFelix Fietkau e604546784 mt76: mt7615: fix some checkpatch warnings
This fixes the following checkpatch warnings:

WARNING: Improper SPDX comment style
Fix blank lines.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:21:30 +02:00
Lorenzo BianconiandFelix Fietkau 8919516006 mt76: mt7615: add radar pattern test knob to debugfs
Introduce mt7615_mcu_rdd_send_pattern routine to trigger a radar pattern
detection. Moreover move debugfs related routines in a dedicated source
file.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-07-01 14:09:17 +02:00