aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-05 13:49:42 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-17 16:17:36 -0400
commit54a9aa65f749673f851ef86481940394185c1b0e (patch)
tree57763e1d758985c3238d9d182a2c083e738bfdd0 /drivers
parent91835ba401189a81e5ad1f932f880d8eed8c9db2 (diff)
iwlagn: keep track of failure tx status
Tx command response sent to host by uCode after completed the transmission attempt. The status parameter indicates whether the transmission was successful, or else why if failed. Here we keep the counters to help understand the different failure cases. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c97
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c14
8 files changed, 126 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 674fb93ae17f..56ef4ed0db47 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -223,6 +223,7 @@ static struct iwl_lib_ops iwl1000_lib = {
223 .tx_stats_read = iwl_ucode_tx_stats_read, 223 .tx_stats_read = iwl_ucode_tx_stats_read,
224 .general_stats_read = iwl_ucode_general_stats_read, 224 .general_stats_read = iwl_ucode_general_stats_read,
225 .bt_stats_read = iwl_ucode_bt_stats_read, 225 .bt_stats_read = iwl_ucode_bt_stats_read,
226 .reply_tx_error = iwl_reply_tx_error_read,
226 }, 227 },
227 .recover_from_tx_stall = iwl_bg_monitor_recover, 228 .recover_from_tx_stall = iwl_bg_monitor_recover,
228 .check_plcp_health = iwl_good_plcp_health, 229 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 1d6a46d4db59..943a9c7bfa7f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2289,6 +2289,7 @@ static struct iwl_lib_ops iwl4965_lib = {
2289 .tx_stats_read = iwl_ucode_tx_stats_read, 2289 .tx_stats_read = iwl_ucode_tx_stats_read,
2290 .general_stats_read = iwl_ucode_general_stats_read, 2290 .general_stats_read = iwl_ucode_general_stats_read,
2291 .bt_stats_read = iwl_ucode_bt_stats_read, 2291 .bt_stats_read = iwl_ucode_bt_stats_read,
2292 .reply_tx_error = iwl_reply_tx_error_read,
2292 }, 2293 },
2293 .recover_from_tx_stall = iwl_bg_monitor_recover, 2294 .recover_from_tx_stall = iwl_bg_monitor_recover,
2294 .check_plcp_health = iwl_good_plcp_health, 2295 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index b9399fbcee97..21b4b23368e6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -404,6 +404,7 @@ static struct iwl_lib_ops iwl5000_lib = {
404 .tx_stats_read = iwl_ucode_tx_stats_read, 404 .tx_stats_read = iwl_ucode_tx_stats_read,
405 .general_stats_read = iwl_ucode_general_stats_read, 405 .general_stats_read = iwl_ucode_general_stats_read,
406 .bt_stats_read = iwl_ucode_bt_stats_read, 406 .bt_stats_read = iwl_ucode_bt_stats_read,
407 .reply_tx_error = iwl_reply_tx_error_read,
407 }, 408 },
408 .recover_from_tx_stall = iwl_bg_monitor_recover, 409 .recover_from_tx_stall = iwl_bg_monitor_recover,
409 .check_plcp_health = iwl_good_plcp_health, 410 .check_plcp_health = iwl_good_plcp_health,
@@ -475,6 +476,7 @@ static struct iwl_lib_ops iwl5150_lib = {
475 .tx_stats_read = iwl_ucode_tx_stats_read, 476 .tx_stats_read = iwl_ucode_tx_stats_read,
476 .general_stats_read = iwl_ucode_general_stats_read, 477 .general_stats_read = iwl_ucode_general_stats_read,
477 .bt_stats_read = iwl_ucode_bt_stats_read, 478 .bt_stats_read = iwl_ucode_bt_stats_read,
479 .reply_tx_error = iwl_reply_tx_error_read,
478 }, 480 },
479 .recover_from_tx_stall = iwl_bg_monitor_recover, 481 .recover_from_tx_stall = iwl_bg_monitor_recover,
480 .check_plcp_health = iwl_good_plcp_health, 482 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 2fdba088bd27..9f43f2770c96 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -329,6 +329,7 @@ static struct iwl_lib_ops iwl6000_lib = {
329 .tx_stats_read = iwl_ucode_tx_stats_read, 329 .tx_stats_read = iwl_ucode_tx_stats_read,
330 .general_stats_read = iwl_ucode_general_stats_read, 330 .general_stats_read = iwl_ucode_general_stats_read,
331 .bt_stats_read = iwl_ucode_bt_stats_read, 331 .bt_stats_read = iwl_ucode_bt_stats_read,
332 .reply_tx_error = iwl_reply_tx_error_read,
332 }, 333 },
333 .recover_from_tx_stall = iwl_bg_monitor_recover, 334 .recover_from_tx_stall = iwl_bg_monitor_recover,
334 .check_plcp_health = iwl_good_plcp_health, 335 .check_plcp_health = iwl_good_plcp_health,
@@ -404,6 +405,7 @@ static struct iwl_lib_ops iwl6000g2b_lib = {
404 .tx_stats_read = iwl_ucode_tx_stats_read, 405 .tx_stats_read = iwl_ucode_tx_stats_read,
405 .general_stats_read = iwl_ucode_general_stats_read, 406 .general_stats_read = iwl_ucode_general_stats_read,
406 .bt_stats_read = iwl_ucode_bt_stats_read, 407 .bt_stats_read = iwl_ucode_bt_stats_read,
408 .reply_tx_error = iwl_reply_tx_error_read,
407 }, 409 },
408 .recover_from_tx_stall = iwl_bg_monitor_recover, 410 .recover_from_tx_stall = iwl_bg_monitor_recover,
409 .check_plcp_health = iwl_good_plcp_health, 411 .check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index d706b8afbe5a..de68dde4feee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -1011,3 +1011,100 @@ ssize_t iwl_ucode_bt_stats_read(struct file *file,
1011 kfree(buf); 1011 kfree(buf);
1012 return ret; 1012 return ret;
1013} 1013}
1014
1015ssize_t iwl_reply_tx_error_read(struct file *file,
1016 char __user *user_buf,
1017 size_t count, loff_t *ppos)
1018{
1019 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
1020 int pos = 0;
1021 char *buf;
1022 int bufsz = (sizeof(struct reply_tx_error_statistics) * 24) + 200;
1023 ssize_t ret;
1024
1025 if (!iwl_is_alive(priv))
1026 return -EAGAIN;
1027
1028 buf = kzalloc(bufsz, GFP_KERNEL);
1029 if (!buf) {
1030 IWL_ERR(priv, "Can not allocate Buffer\n");
1031 return -ENOMEM;
1032 }
1033
1034 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_TX_Error:\n");
1035 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t\t%u\n",
1036 iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_DELAY),
1037 priv->_agn.reply_tx_stats.pp_delay);
1038 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1039 iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_FEW_BYTES),
1040 priv->_agn.reply_tx_stats.pp_few_bytes);
1041 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1042 iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_BT_PRIO),
1043 priv->_agn.reply_tx_stats.pp_bt_prio);
1044 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1045 iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_QUIET_PERIOD),
1046 priv->_agn.reply_tx_stats.pp_quiet_period);
1047 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1048 iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_CALC_TTAK),
1049 priv->_agn.reply_tx_stats.pp_calc_ttak);
1050 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n",
1051 iwl_get_tx_fail_reason(
1052 TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY),
1053 priv->_agn.reply_tx_stats.int_crossed_retry);
1054 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1055 iwl_get_tx_fail_reason(TX_STATUS_FAIL_SHORT_LIMIT),
1056 priv->_agn.reply_tx_stats.short_limit);
1057 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1058 iwl_get_tx_fail_reason(TX_STATUS_FAIL_LONG_LIMIT),
1059 priv->_agn.reply_tx_stats.long_limit);
1060 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1061 iwl_get_tx_fail_reason(TX_STATUS_FAIL_FIFO_UNDERRUN),
1062 priv->_agn.reply_tx_stats.fifo_underrun);
1063 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1064 iwl_get_tx_fail_reason(TX_STATUS_FAIL_DRAIN_FLOW),
1065 priv->_agn.reply_tx_stats.drain_flow);
1066 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1067 iwl_get_tx_fail_reason(TX_STATUS_FAIL_RFKILL_FLUSH),
1068 priv->_agn.reply_tx_stats.rfkill_flush);
1069 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1070 iwl_get_tx_fail_reason(TX_STATUS_FAIL_LIFE_EXPIRE),
1071 priv->_agn.reply_tx_stats.life_expire);
1072 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1073 iwl_get_tx_fail_reason(TX_STATUS_FAIL_DEST_PS),
1074 priv->_agn.reply_tx_stats.dest_ps);
1075 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1076 iwl_get_tx_fail_reason(TX_STATUS_FAIL_HOST_ABORTED),
1077 priv->_agn.reply_tx_stats.host_abort);
1078 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1079 iwl_get_tx_fail_reason(TX_STATUS_FAIL_BT_RETRY),
1080 priv->_agn.reply_tx_stats.pp_delay);
1081 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1082 iwl_get_tx_fail_reason(TX_STATUS_FAIL_STA_INVALID),
1083 priv->_agn.reply_tx_stats.sta_invalid);
1084 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1085 iwl_get_tx_fail_reason(TX_STATUS_FAIL_FRAG_DROPPED),
1086 priv->_agn.reply_tx_stats.frag_drop);
1087 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1088 iwl_get_tx_fail_reason(TX_STATUS_FAIL_TID_DISABLE),
1089 priv->_agn.reply_tx_stats.tid_disable);
1090 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1091 iwl_get_tx_fail_reason(TX_STATUS_FAIL_FIFO_FLUSHED),
1092 priv->_agn.reply_tx_stats.fifo_flush);
1093 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n",
1094 iwl_get_tx_fail_reason(
1095 TX_STATUS_FAIL_INSUFFICIENT_CF_POLL),
1096 priv->_agn.reply_tx_stats.insuff_cf_poll);
1097 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
1098 iwl_get_tx_fail_reason(TX_STATUS_FAIL_FW_DROP),
1099 priv->_agn.reply_tx_stats.fail_hw_drop);
1100 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t%u\n",
1101 iwl_get_tx_fail_reason(
1102 TX_STATUS_FAIL_STA_COLOR_MISMATCH_DROP),
1103 priv->_agn.reply_tx_stats.sta_color_mismatch);
1104 pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n",
1105 priv->_agn.reply_tx_stats.unknown);
1106
1107 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1108 kfree(buf);
1109 return ret;
1110}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
index bbdce5913ac7..f2573b5486cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
@@ -39,6 +39,8 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
39 size_t count, loff_t *ppos); 39 size_t count, loff_t *ppos);
40ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf, 40ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
41 size_t count, loff_t *ppos); 41 size_t count, loff_t *ppos);
42ssize_t iwl_reply_tx_error_read(struct file *file, char __user *user_buf,
43 size_t count, loff_t *ppos);
42#else 44#else
43static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, 45static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
44 size_t count, loff_t *ppos) 46 size_t count, loff_t *ppos)
@@ -60,4 +62,9 @@ static ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
60{ 62{
61 return 0; 63 return 0;
62} 64}
65static ssize_t iwl_reply_tx_error_read(struct file *file, char __user *user_buf,
66 size_t count, loff_t *ppos)
67{
68 return 0;
69}
63#endif 70#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index f1d40c6173c1..f0302bfe85f5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -130,6 +130,8 @@ struct iwl_debugfs_ops {
130 size_t count, loff_t *ppos); 130 size_t count, loff_t *ppos);
131 ssize_t (*bt_stats_read)(struct file *file, char __user *user_buf, 131 ssize_t (*bt_stats_read)(struct file *file, char __user *user_buf,
132 size_t count, loff_t *ppos); 132 size_t count, loff_t *ppos);
133 ssize_t (*reply_tx_error)(struct file *file, char __user *user_buf,
134 size_t count, loff_t *ppos);
133}; 135};
134 136
135struct iwl_temp_ops { 137struct iwl_temp_ops {
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index e0b31a2a1dac..265ad01a443f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1642,6 +1642,18 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
1642 return count; 1642 return count;
1643} 1643}
1644 1644
1645static ssize_t iwl_dbgfs_reply_tx_error_read(struct file *file,
1646 char __user *user_buf,
1647 size_t count, loff_t *ppos)
1648{
1649 struct iwl_priv *priv = file->private_data;
1650
1651 if (priv->cfg->ops->lib->debugfs_ops.reply_tx_error)
1652 return priv->cfg->ops->lib->debugfs_ops.reply_tx_error(
1653 file, user_buf, count, ppos);
1654 else
1655 return -ENODATA;
1656}
1645DEBUGFS_READ_FILE_OPS(rx_statistics); 1657DEBUGFS_READ_FILE_OPS(rx_statistics);
1646DEBUGFS_READ_FILE_OPS(tx_statistics); 1658DEBUGFS_READ_FILE_OPS(tx_statistics);
1647DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 1659DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -1668,6 +1680,7 @@ DEBUGFS_READ_FILE_OPS(ucode_bt_stats);
1668DEBUGFS_WRITE_FILE_OPS(monitor_period); 1680DEBUGFS_WRITE_FILE_OPS(monitor_period);
1669DEBUGFS_READ_FILE_OPS(bt_traffic); 1681DEBUGFS_READ_FILE_OPS(bt_traffic);
1670DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); 1682DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
1683DEBUGFS_READ_FILE_OPS(reply_tx_error);
1671 1684
1672/* 1685/*
1673 * Create the debugfs files and directories 1686 * Create the debugfs files and directories
@@ -1738,6 +1751,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1738 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR); 1751 DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
1739 if (priv->cfg->bt_statistics) 1752 if (priv->cfg->bt_statistics)
1740 DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR); 1753 DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
1754 DEBUGFS_ADD_FILE(reply_tx_error, dir_debug, S_IRUSR);
1741 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 1755 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
1742 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 1756 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
1743 DEBUGFS_ADD_FILE(monitor_period, dir_debug, S_IWUSR); 1757 DEBUGFS_ADD_FILE(monitor_period, dir_debug, S_IWUSR);