Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5046019 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Luciano Coelho
Browse files

iwlwifi: mvm: add debugfs hook to send ECHO_CMD to the firmware



ECHO_CMD is a simple command that can be sent to the
firmware just to check that it is alive.
This command is useful for debug purpose, provide a debugfs
hook to send it.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
parent 62e004fe
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1361,11 +1361,25 @@ iwl_dbgfs_prph_reg_write(struct iwl_mvm *mvm, char *buf,
	return count;
}

static ssize_t
iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf,
			      size_t count, loff_t *ppos)
{
	int ret;

	mutex_lock(&mvm->mutex);
	ret = iwl_mvm_send_cmd_pdu(mvm, ECHO_CMD, 0, 0, NULL);
	mutex_unlock(&mvm->mutex);

	return ret ?: count;
}

MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64);

/* Device wide debugfs entries */
MVM_DEBUGFS_WRITE_FILE_OPS(tx_flush, 16);
MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain, 8);
MVM_DEBUGFS_WRITE_FILE_OPS(send_echo_cmd, 8);
MVM_DEBUGFS_READ_WRITE_FILE_OPS(sram, 64);
MVM_DEBUGFS_READ_WRITE_FILE_OPS(set_nic_temperature, 64);
MVM_DEBUGFS_READ_FILE_OPS(nic_temp);
@@ -1425,6 +1439,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
	MVM_DEBUGFS_ADD_FILE(d0i3_refs, mvm->debugfs_dir, S_IRUSR | S_IWUSR);
	MVM_DEBUGFS_ADD_FILE(fw_dbg_conf, mvm->debugfs_dir, S_IRUSR | S_IWUSR);
	MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, S_IWUSR);
	MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, S_IWUSR);
	if (!debugfs_create_bool("enable_scan_iteration_notif",
				 S_IRUSR | S_IWUSR,
				 mvm->debugfs_dir,
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ enum iwl_mvm_tx_fifo {
enum {
	MVM_ALIVE = 0x1,
	REPLY_ERROR = 0x2,
	ECHO_CMD = 0x3,

	INIT_COMPLETE_NOTIF = 0x4,

+1 −0
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
static const char *const iwl_mvm_cmd_strings[REPLY_MAX + 1] = {
	CMD(MVM_ALIVE),
	CMD(REPLY_ERROR),
	CMD(ECHO_CMD),
	CMD(INIT_COMPLETE_NOTIF),
	CMD(PHY_CONTEXT_CMD),
	CMD(MGMT_MCAST_KEY),