]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iwlwifi: mvm: add debugfs entry to trigger a dump as any time-point
authorMordechay Goodstein <mordechay.goodstein@intel.com>
Sun, 31 Jan 2021 18:22:05 +0000 (20:22 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 5 Feb 2021 09:57:44 +0000 (11:57 +0200)
This is used for different tests collecting different types of
debug data from fw (e.g latency issues, hw issues etc).

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210131201908.0db829694810.I001f39d34ae46c87870d9bd94a4baaa3250578d1@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c

index 3834d7197e11272ec41cda6df2aaf727a9774ae7..efc908231d7496c5994ff1e7fbe90b1c2acedb8c 100644 (file)
@@ -1349,6 +1349,24 @@ static ssize_t iwl_dbgfs_fw_dbg_collect_write(struct iwl_mvm *mvm,
        return count;
 }
 
+static ssize_t iwl_dbgfs_dbg_time_point_write(struct iwl_mvm *mvm,
+                                             char *buf, size_t count,
+                                             loff_t *ppos)
+{
+       u32 timepoint;
+
+       if (kstrtou32(buf, 0, &timepoint))
+               return -EINVAL;
+
+       if (timepoint == IWL_FW_INI_TIME_POINT_INVALID ||
+           timepoint >= IWL_FW_INI_TIME_POINT_NUM)
+               return -EINVAL;
+
+       iwl_dbg_tlv_time_point(&mvm->fwrt, timepoint, NULL);
+
+       return count;
+}
+
 #define ADD_TEXT(...) pos += scnprintf(buf + pos, bufsz - pos, __VA_ARGS__)
 #ifdef CONFIG_IWLWIFI_BCAST_FILTERING
 static ssize_t iwl_dbgfs_bcast_filters_read(struct file *file,
@@ -1786,6 +1804,7 @@ MVM_DEBUGFS_WRITE_FILE_OPS(bt_force_ant, 10);
 MVM_DEBUGFS_READ_WRITE_FILE_OPS(scan_ant_rxchain, 8);
 MVM_DEBUGFS_READ_WRITE_FILE_OPS(fw_dbg_conf, 8);
 MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 64);
+MVM_DEBUGFS_WRITE_FILE_OPS(dbg_time_point, 64);
 MVM_DEBUGFS_WRITE_FILE_OPS(indirection_tbl,
                           (IWL_RSS_INDIRECTION_TABLE_SIZE * 2));
 MVM_DEBUGFS_WRITE_FILE_OPS(inject_packet, 512);