Commit Graph
66 Commits
Author SHA1 Message Date
Felix Fietkau f3d4eb6d45 sync with upstream
Signed-off-by: Felix Fietkau <[email protected]>
2022-11-12 19:56:14 +01:00
Ryder LeeandFelix Fietkau 6b0668de7a wifi: mt76: mt7915: add full system reset into debugfs
Trigger firmware crash and enable full system recovery through debugfs.
This also renames knob "fw_ser" to a clear-cut name "sys_recovery".

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-11-11 11:38:25 +01:00
Lorenzo BianconiandFelix Fietkau 65c70a32f1 wifi: mt76: move aggr_stats array in mt76_phy
Move aggregation stats array per-phy instead of share it between multiple
interfaces. This is a preliminary patch to add mt7996 driver support.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-11-11 11:38:25 +01:00
Evelyn TsaiandFelix Fietkau 06df7e6892 wifi: mt76: mt7915: reserve 8 bits for the index of rf registers
The value of regidx of rf registers is combined with WF selection and
offset. Extend the WF selection field from 4 to 8 bits since the
adie index should also be specified.

Signed-off-by: Evelyn Tsai <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-10-01 14:38:05 +02:00
Howard HsuandFelix Fietkau e06376af21 wifi: mt76: mt7915: do not check state before configuring implicit beamform
Do not need to check running state before configuring implicit Tx
beamform. It is okay to configure implicit Tx beamform in run time.
Noted that the existing connected stations will be applied for new
configuration only if they reconnected to the interface.

Fixes: 6377b7f330 ("mt76: mt7915: add implicit Tx beamforming support")

Signed-off-by: Howard Hsu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-09-15 13:15:49 +02:00
Dan CarpenterandFelix Fietkau d299ad96d8 mt76: mt7915: fix endian bug in mt7915_rf_regval_set()
This code is supposed to set a u32 value, but casting will not work on
big endian systems.

Fixes: 0a17329ae9c1 ("mt76: mt7915: add debugfs knob for RF registers read/write")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-02 21:39:30 +02:00
Lorenzo BianconiandFelix Fietkau e1b2c18eee mt76: mt7915: fix endianness in mt7915_rf_regval_get
Fix the following sparse warning in mt7915_rf_regval_get routine:
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:979:16: warning: cast to restricted __le32

Fixes: 0a17329ae9c1f ("mt76: mt7915: add debugfs knob for RF registers read/write")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-06-02 21:39:30 +02:00
Ryder LeeandFelix Fietkau 838529da64 mt76: mt7915: add more statistics from fw_util debugfs knobs
Print out exception state and program counters of WA/WM MCUs.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-05-12 11:33:17 +02:00
Ryder LeeandFelix Fietkau bb54f5e1c1 mt76: mt7915: improve error handling for fw_debug knobs
In case fw.debug_wm/wa might be unavailable.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-05-12 11:31:01 +02:00
Ryder LeeandFelix Fietkau 84319691b7 mt76: mt7915: reowrk SER debugfs knob
1. get status of system recovery from firmware.
2. add more recovery points.
3. make knob per phy.

Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-05-05 14:27:56 +02:00
Shayne ChenandFelix Fietkau 795830a99a mt76: mt7915: add debugfs knob for RF registers read/write
Add RF registers read/write support for debugging RF issues, which
should be processed by mcu commands.
The index of rf registers use the generic regidx, and are combined
with two parts: WF selection [31:28] and offset [27:0].

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
2022-04-20 13:23:48 +02:00
Lorenzo BianconiandFelix Fietkau fe441e5d3d mt76: mt7915: do not pass data pointer to mt7915_mcu_muru_debug_set
Fix typo in mt7915_muru_debug_set routine and pass muru_debug value to
mt7915_mcu_muru_debug_set() instead of data pointer.

Fixes: 1966a5078f2d2 (mt76: mt7915: add mu-mimo and ofdma debugfs knobs")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-04-07 12:22:27 +02:00
Lorenzo BianconiandFelix Fietkau d60f335e78 mt76: mt7915: fix endianness warnings in mt7915_debugfs_rx_fw_monitor
Fix the following sparse warnings:
warning: incorrect type in initializer (different base types)
   expected restricted __le16 [usertype] msg_type
   got int
warning: incorrect type in assignment (different base types)
   expected restricted __le32 [usertype] timestamp
   got unsigned int

Fixes: 988845c9361a0 ("mt76: mt7915: add support for passing chip/firmware debug data to user space")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-02-14 15:08:04 +01:00
Bo JiaoandFelix Fietkau 7f1818cd8f mt76: mt7915: introduce band_idx in mt7915_phy
The wfsys of MT7986 has only single adie chip for non-dbdc devices,
and it binds to band1 by default. Hence this patch adds band_idx to
explicitly configure phy accordingly.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-02-14 15:08:04 +01:00
Lorenzo BianconiandFelix Fietkau 4c76a6c3a1 mt76: mt7915: introduce rdd_monitor debugfs node
Introduce rdd_monitor debugfs node in order to dump rdd2 configuration.

Tested-by: Owen Peng <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-01-28 14:38:45 +01:00
Lorenzo BianconiandFelix Fietkau 93c03778f9 mt76: mt7915: enable radar trigger on rdd2
Enable radar trigger for rdd2 in mt7915_radar_trigger.

Tested-by: Evelyn Tsai <[email protected]>
Tested-by: Owen Peng <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-01-28 14:38:45 +01:00
Felix Fietkau 976ea38797 mt76: mt7915: add support for passing chip/firmware debug data to user space
This can be used to assist in debugging driver or firmware tx/rx issues.
The data is streamed to user space using a relay file in debugfs

Signed-off-by: Felix Fietkau <[email protected]>
2022-01-06 10:42:46 +01:00
Lorenzo BianconiandFelix Fietkau 058de6d36f mt76: connac: move mt76_connac_mcu_rdd_cmd in mt76-connac module
Move mt76_connac_mcu_rdd_cmd routine in mt76-connac module and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-29 12:09:02 +01:00
Bo JiaoandFelix Fietkau 15f9f88b36 mt76: mt7915: refine register definition
Add mt7915_reg_desc to differentiate chip generations.
This is an intermediate patch to introduce mt7916 support.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-20 10:57:00 +01:00
MeiChia ChiuandFelix Fietkau b041a8a300 mt76: mt7915: add mu-mimo and ofdma debugfs knobs
Add mu-mimo and ofdma packet counters statistics.
The statistics are clear on read.

Reviewed-by: Money Wang <[email protected]>
Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: MeiChia Chiu <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-15 21:22:55 +01:00
Lorenzo BianconiandFelix Fietkau 812b73f2f1 mt76: mt7915: introduce mt76_vif in mt7915_vif
Align mt7915_vif layout to mt7921_vif and mt7615_vif

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-12-15 21:22:55 +01:00
Shayne ChenandFelix Fietkau ed3d8569c4 mt76: mt7915: add debugfs knobs for MCU utilization
Add debugfs knobs to read MCU utilization, which helps user know
firmware status more easily to narrow down CPU bottleneck issues.

Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Shayne ChenandFelix Fietkau b52adf9815 mt76: mt7915: add WA firmware log support
Support to turn on/off WA firmware log from debugfs.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Ryder LeeandFelix Fietkau 577d45f6e4 mt76: mt7915: rework debugfs fixed-rate knob
Switch to use new mt7915_mcu_set_fixed_rate_ctrl().

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:06 +02:00
Lorenzo BianconiandFelix Fietkau 4a11cb67dc mt76: mt7915: move tx amsdu stats in mib_stats
Move tx_amsdu histogram stats in mib_stats structure since registers are
clear-on-read

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau f80ab6dde6 mt76: mt7915: run mt7915_get_et_stats holding mt76 mutex
Since it can run in parallel with mac_work, hold mutex lock in
mt7915_get_et_stats. Moreover update mib counters running
mt7915_get_et_stats.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:33:21 +02:00
Lorenzo BianconiandFelix Fietkau 60dd47a0a6 mt76: mt7915: remove dead code in debugfs code
Remove some more not used code in mt7915 debugfs.
Squash mt7915_puts_rate_txpower and mt7915_rate_txpower_show.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 12:12:48 +02:00
Lorenzo BianconiandFelix Fietkau 10e85d62f2 mt76: mt7915: improve code readability for xmit-queue handler
Improve xmit-queue debugfs node readability for mt7915

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 11:29:44 +02:00
Lorenzo BianconiandFelix Fietkau 0af0af82bb mt76: mt7915: introduce mt76 debugfs sub-dir for ext-phy
Introduce a dedicated mt76 debugfs sub-dir for ext-phy in dbdc mode.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-19 11:29:44 +02:00
Lorenzo BianconiandFelix Fietkau 440e2db8d5 mt76: mt7915: add twt_stats knob in debugfs
Introduce twt_stats knob in debugfs in order to dump established
agreements

Tested-by: Peter Chiu <[email protected]>
Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-11 11:53:39 +02:00
Ben GreearandFelix Fietkau f4dde5f765 mt76: mt7915: add tx mu/su counters to mib
These counters are clear-on-read, so we need to accumulate
them in the update_stats poll logic, and read the accumulated
values instead of directly doing register reads when reporting
to debugfs and ethtool stats.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-11 08:03:30 +02:00
Ryder LeeandFelix Fietkau 62ffc31f4d mt76: mt7915: rename debugfs tx-queues
Rename "queues" to "tx-queues" to reflect its meaning.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-09-24 17:38:21 +02:00
Ryder LeeandFelix Fietkau 5a0f2382fc mt76: mt7915: rework debugfs queue info
Complete PSE/PLE queue statistics, including per-sta AC queue
information.

Co-developed-by: Sujuan Chen <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-09-24 17:36:42 +02:00
Ryder LeeandFelix Fietkau bc7ee7d7bd mt76: mt7915: add HE-LTF into fixed rate command
Add HE-LTF control.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-08-13 12:54:37 +02:00
Ryder LeeandFelix Fietkau 8e2d383fbd mt76: mt7915: report tx rate directly from tx status
Report tx rate from tx status packets instead of receving periodic mcu
event. This improves flexibility, accuracy and AQL performance, and
simplifies code flow for better readability.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-07-14 15:54:43 +02:00
Ryder LeeandFelix Fietkau c13df42282 mt76: mt7915: improve MU stability
- Adjust starec flow since VHT MU group is only updated by starec_vht
  follows starec_bf settings.
- Drop unnecessary MU BF checks.

TX MPDU PER (Status = Success):
                                           TOT_MPDU_CNT  FAIL_MPDU_CNT  TX_PER
WCID Rate
1      VHT_BW80_2SS_MCS7_LGI_LDPC_MUBF              114              0   0.00%
       VHT_BW80_2SS_MCS7_LGI_LDPC_MUBF_MU            64              0   0.00%
       VHT_BW80_2SS_MCS7_SGI_LDPC_MUBF              128              0   0.00%
       VHT_BW80_2SS_MCS7_SGI_LDPC_MUBF_MU           745              0   0.00%
       VHT_BW80_2SS_MCS8_LGI_LDPC_MUBF_MU           856              0   0.00%
       VHT_BW80_2SS_MCS8_SGI_LDPC_MUBF_MU          1430              4   0.28%
       VHT_BW80_2SS_MCS9_LGI_LDPC_MUBF_MU          5220             31   0.59%
       VHT_BW80_2SS_MCS9_LGI_LDPC_iBF                59              0   0.00%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF               64              2   3.12%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF_MU         22132             76   0.34%
       VHT_BW80_2SS_MCS9_SGI_LDPC_iBF              2866              1   0.03%
2      VHT_BW80_2SS_MCS7_LGI_LDPC_MUBF_MU          3781              5   0.13%
       VHT_BW80_2SS_MCS7_SGI_LDPC_MUBF_MU           735              0   0.00%
       VHT_BW80_2SS_MCS8_LGI_LDPC_MUBF_MU          1270            365  28.74%
       VHT_BW80_2SS_MCS8_SGI_LDPC_MUBF_MU          3420             57   1.67%
       VHT_BW80_2SS_MCS9_LGI_LDPC_MUBF              128              0   0.00%
       VHT_BW80_2SS_MCS9_LGI_LDPC_MUBF_MU            64              0   0.00%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF              191              0   0.00%
       VHT_BW80_2SS_MCS9_SGI_LDPC_MUBF_MU         18833            320   1.70%
       VHT_BW80_2SS_MCS9_SGI_LDPC_iBF              6040              0   0.00%
287    OFDM 6M

Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-18 16:38:20 +02:00
Ryder LeeandFelix Fietkau 5ca602fb94 mt76: mt7915: introduce mt7915_mcu_set_txbf()
Use mt7915_mcu_set_txbf() to reduce global functions. This can be
easily extended to support other TxBF commands in further patches.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-18 16:38:20 +02:00
Shayne ChenandFelix Fietkau 6f871f35e3 mt76: mt7915: use mt7915_mcu_get_txpower_sku() to get per-rate txpower
Get per-rate txpower with mcu command. This is the preparation of
co-driver for the next chipset, which has different tmac power registers
but can share this same command.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-28 11:52:34 +02:00
Ryder LeeandFelix Fietkau 3c90f35ddd mt76: mt7915: add thermal sensor device support
This provides userspace with a unified interface, hwmon sysfs, to monitor
temperature in the hardware and can be adapted to system monitoring tools.

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
Junlin YangandFelix Fietkau ef96fafad8 mt76: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Junlin Yang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2021-04-17 11:27:04 +02:00
Shayne ChenandFelix Fietkau c8c78e5772 mt76: mt7915: directly read per-rate tx power from registers
Since driver no longer handler per-rate tx power setting, we need to
read the power values directly from registers.

Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-17 11:27:04 +02:00
Shayne ChenandFelix Fietkau e8dacf59ab mt76: mt7915: rework the flow of txpower setting
Clean up the flow of per-rate txpower limit setting to get rid of
duplicate work since it has already been handled by firmware, and set
proper max_power based on different channels and regdomains.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-17 11:27:04 +02:00
Felix Fietkau c71f609b39 mt76: sync with upstream changes
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-14 09:12:11 +02:00
Lorenzo BianconiandFelix Fietkau 84229a5184 mt76: mt7915: fix aggr len debugfs node
Similar to mt7921, fix 802.11 aggr len debugfs reporting for mt7915 driver.

Fixes: e57b7901469fc ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:38:18 +01:00
Ryder LeeandFelix Fietkau 6377b7f330 mt76: mt7915: add implicit Tx beamforming support
Add ht/vht implicit Tx beamforming support and enable it via debugfs.

Tested-by: Shayne Chen <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 11:25:11 +01:00
Lorenzo BianconiandFelix Fietkau 1e34a02c2d mt76: mt7915: get rid of dbdc debugfs knob
mt7915 automatically detects dbdc feature so drop debugfs knob.
Move if_comb, mt7915_rates, if_limits structs and mt7915_regd_notifier(),
mt7915_init_wiphy() routines at the begging of init.c in order to make
mt7915_register_ext_phy routine static

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-13 11:23:27 +01:00
Lorenzo BianconiandFelix Fietkau b436da4d9d mt76: mt7915: introduce dbdc support
Introduce mt7915 dbdc support. If dbdc is available, mt7915 primary phy
will work on 2.4GHz band, while secondary one on 5GHz band.

Co-developed-by: Shayne Chen <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-13 11:19:28 +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
Taehee YooandFelix Fietkau 33b89f4a1b mt76: set fops_tx_stats.owner to THIS_MODULE
If THIS_MODULE is not set, the module would be removed while debugfs is
being used.
It eventually makes kernel panic.

Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Taehee Yoo <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-10-11 21:50:08 +02:00