Commit 7e4005cc authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by John W. Linville

iwlagn: add "echo test" command to debugfs

For command queue testing, add "echo test" to debugfs
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 46e7741e
...@@ -1734,12 +1734,18 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -1734,12 +1734,18 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int iwl_cmd_echo_test(struct iwl_priv *priv) int iwl_cmd_echo_test(struct iwl_priv *priv)
{ {
int ret;
struct iwl_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_ECHO, .id = REPLY_ECHO,
.flags = CMD_SYNC, .flags = CMD_SYNC,
}; };
return iwl_trans_send_cmd(trans(priv), &cmd); ret = iwl_trans_send_cmd(trans(priv), &cmd);
if (ret)
IWL_ERR(priv, "echo testing fail: 0X%x\n", ret);
else
IWL_DEBUG_INFO(priv, "echo testing pass\n");
return ret;
} }
static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq) static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq)
......
...@@ -2444,6 +2444,23 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file, ...@@ -2444,6 +2444,23 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
return count; return count;
} }
static ssize_t iwl_dbgfs_echo_test_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct iwl_priv *priv = file->private_data;
char buf[8];
int buf_size;
memset(buf, 0, sizeof(buf));
buf_size = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT;
iwl_cmd_echo_test(priv);
return count;
}
DEBUGFS_READ_FILE_OPS(rx_statistics); DEBUGFS_READ_FILE_OPS(rx_statistics);
DEBUGFS_READ_FILE_OPS(tx_statistics); DEBUGFS_READ_FILE_OPS(tx_statistics);
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
...@@ -2467,6 +2484,7 @@ DEBUGFS_WRITE_FILE_OPS(wd_timeout); ...@@ -2467,6 +2484,7 @@ DEBUGFS_WRITE_FILE_OPS(wd_timeout);
DEBUGFS_READ_FILE_OPS(bt_traffic); DEBUGFS_READ_FILE_OPS(bt_traffic);
DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
DEBUGFS_READ_FILE_OPS(reply_tx_error); DEBUGFS_READ_FILE_OPS(reply_tx_error);
DEBUGFS_WRITE_FILE_OPS(echo_test);
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
static ssize_t iwl_dbgfs_debug_level_read(struct file *file, static ssize_t iwl_dbgfs_debug_level_read(struct file *file,
...@@ -2575,6 +2593,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) ...@@ -2575,6 +2593,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR);
if (iwl_advanced_bt_coexist(priv)) if (iwl_advanced_bt_coexist(priv))
DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
......
...@@ -47,6 +47,7 @@ const char *get_cmd_string(u8 cmd) ...@@ -47,6 +47,7 @@ const char *get_cmd_string(u8 cmd)
switch (cmd) { switch (cmd) {
IWL_CMD(REPLY_ALIVE); IWL_CMD(REPLY_ALIVE);
IWL_CMD(REPLY_ERROR); IWL_CMD(REPLY_ERROR);
IWL_CMD(REPLY_ECHO);
IWL_CMD(REPLY_RXON); IWL_CMD(REPLY_RXON);
IWL_CMD(REPLY_RXON_ASSOC); IWL_CMD(REPLY_RXON_ASSOC);
IWL_CMD(REPLY_QOS_PARAM); IWL_CMD(REPLY_QOS_PARAM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment