aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2011-10-10 10:26:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-10-14 14:48:09 -0400
commit7e4005cc4ae49100582ee1c97368dd79474f0a82 (patch)
tree4ad287cc0c2144f04504ecbb8e5ad379b7bfd68b /drivers/net
parent46e7741ea176b6bb86d9d0ae5770c2e7528dc146 (diff)
iwlagn: add "echo test" command to debugfs
For command queue testing, add "echo test" to debugfs Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c19
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c1
3 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 9cb6c755279e..2cc6399dafa4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1734,12 +1734,18 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1734 1734
1735int iwl_cmd_echo_test(struct iwl_priv *priv) 1735int iwl_cmd_echo_test(struct iwl_priv *priv)
1736{ 1736{
1737 int ret;
1737 struct iwl_host_cmd cmd = { 1738 struct iwl_host_cmd cmd = {
1738 .id = REPLY_ECHO, 1739 .id = REPLY_ECHO,
1739 .flags = CMD_SYNC, 1740 .flags = CMD_SYNC,
1740 }; 1741 };
1741 1742
1742 return iwl_trans_send_cmd(trans(priv), &cmd); 1743 ret = iwl_trans_send_cmd(trans(priv), &cmd);
1744 if (ret)
1745 IWL_ERR(priv, "echo testing fail: 0X%x\n", ret);
1746 else
1747 IWL_DEBUG_INFO(priv, "echo testing pass\n");
1748 return ret;
1743} 1749}
1744 1750
1745static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq) 1751static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 6d49dfbee964..ea1452cf9c90 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2444,6 +2444,23 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
2444 return count; 2444 return count;
2445} 2445}
2446 2446
2447static ssize_t iwl_dbgfs_echo_test_write(struct file *file,
2448 const char __user *user_buf,
2449 size_t count, loff_t *ppos)
2450{
2451 struct iwl_priv *priv = file->private_data;
2452 char buf[8];
2453 int buf_size;
2454
2455 memset(buf, 0, sizeof(buf));
2456 buf_size = min(count, sizeof(buf) - 1);
2457 if (copy_from_user(buf, user_buf, buf_size))
2458 return -EFAULT;
2459
2460 iwl_cmd_echo_test(priv);
2461 return count;
2462}
2463
2447DEBUGFS_READ_FILE_OPS(rx_statistics); 2464DEBUGFS_READ_FILE_OPS(rx_statistics);
2448DEBUGFS_READ_FILE_OPS(tx_statistics); 2465DEBUGFS_READ_FILE_OPS(tx_statistics);
2449DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 2466DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -2467,6 +2484,7 @@ DEBUGFS_WRITE_FILE_OPS(wd_timeout);
2467DEBUGFS_READ_FILE_OPS(bt_traffic); 2484DEBUGFS_READ_FILE_OPS(bt_traffic);
2468DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); 2485DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
2469DEBUGFS_READ_FILE_OPS(reply_tx_error); 2486DEBUGFS_READ_FILE_OPS(reply_tx_error);
2487DEBUGFS_WRITE_FILE_OPS(echo_test);
2470 2488
2471#ifdef CONFIG_IWLWIFI_DEBUG 2489#ifdef CONFIG_IWLWIFI_DEBUG
2472static ssize_t iwl_dbgfs_debug_level_read(struct file *file, 2490static 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 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 2593 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
2576 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 2594 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
2577 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); 2595 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR);
2596 DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR);
2578 if (iwl_advanced_bt_coexist(priv)) 2597 if (iwl_advanced_bt_coexist(priv))
2579 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); 2598 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
2580#ifdef CONFIG_IWLWIFI_DEBUG 2599#ifdef CONFIG_IWLWIFI_DEBUG
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index bcd7f64683aa..bbd674061d2e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -47,6 +47,7 @@ const char *get_cmd_string(u8 cmd)
47 switch (cmd) { 47 switch (cmd) {
48 IWL_CMD(REPLY_ALIVE); 48 IWL_CMD(REPLY_ALIVE);
49 IWL_CMD(REPLY_ERROR); 49 IWL_CMD(REPLY_ERROR);
50 IWL_CMD(REPLY_ECHO);
50 IWL_CMD(REPLY_RXON); 51 IWL_CMD(REPLY_RXON);
51 IWL_CMD(REPLY_RXON_ASSOC); 52 IWL_CMD(REPLY_RXON_ASSOC);
52 IWL_CMD(REPLY_QOS_PARAM); 53 IWL_CMD(REPLY_QOS_PARAM);