mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7915: enable firmware module debug support
This allows host driver to get useful information of some important modules. Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Chih-Min Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -74,6 +74,41 @@ mt7915_dbdc_get(void *data, u64 *val)
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(fops_dbdc, mt7915_dbdc_get,
|
||||
mt7915_dbdc_set, "%lld\n");
|
||||
|
||||
static int
|
||||
mt7915_fw_debug_set(void *data, u64 val)
|
||||
{
|
||||
struct mt7915_dev *dev = data;
|
||||
enum {
|
||||
DEBUG_TXCMD = 62,
|
||||
DEBUG_CMD_RPT_TX,
|
||||
DEBUG_CMD_RPT_TRIG,
|
||||
DEBUG_SPL,
|
||||
DEBUG_RPT_RX,
|
||||
} debug;
|
||||
|
||||
dev->fw_debug = !!val;
|
||||
|
||||
mt7915_mcu_fw_log_2_host(dev, dev->fw_debug ? 2 : 0);
|
||||
|
||||
for (debug = DEBUG_TXCMD; debug <= DEBUG_RPT_RX; debug++)
|
||||
mt7915_mcu_fw_dbg_ctrl(dev, debug, dev->fw_debug);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_fw_debug_get(void *data, u64 *val)
|
||||
{
|
||||
struct mt7915_dev *dev = data;
|
||||
|
||||
*val = dev->fw_debug;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(fops_fw_debug, mt7915_fw_debug_get,
|
||||
mt7915_fw_debug_set, "%lld\n");
|
||||
|
||||
static void
|
||||
mt7915_ampdu_stat_read_phy(struct mt7915_phy *phy,
|
||||
struct seq_file *file)
|
||||
@@ -290,6 +325,7 @@ int mt7915_init_debugfs(struct mt7915_dev *dev)
|
||||
mt7915_queues_acq);
|
||||
debugfs_create_file("tx_stats", 0400, dir, dev, &fops_tx_stats);
|
||||
debugfs_create_file("dbdc", 0600, dir, dev, &fops_dbdc);
|
||||
debugfs_create_file("fw_debug", 0600, dir, dev, &fops_fw_debug);
|
||||
debugfs_create_u32("dfs_hw_pattern", 0400, dir, &dev->hw_pattern);
|
||||
/* test knobs */
|
||||
debugfs_create_file("radar_trigger", 0200, dir, dev,
|
||||
|
||||
Reference in New Issue
Block a user