iwlagn: adding aggregated frame failure status to debugfs
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Sun, 5 Sep 2010 17:49:45 +0000 (10:49 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 17 Sep 2010 20:18:17 +0000 (13:18 -0700)
Addition to standard tx frame failure report, adding aggregated
frame failure report to debugfs

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
drivers/net/wireless/iwlwifi/iwl-agn.h

index de68dde4feee0d81ede6cc10296232acd82d8f40..52e98691ddfd6f368be19301cf50a73916164ff9 100644 (file)
@@ -25,7 +25,7 @@
 *  Intel Linux Wireless <ilw@linux.intel.com>
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 *****************************************************************************/
-
+#include "iwl-agn.h"
 #include "iwl-agn-debugfs.h"
 
 static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz)
@@ -1019,7 +1019,8 @@ ssize_t iwl_reply_tx_error_read(struct file *file,
        struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
        int pos = 0;
        char *buf;
-       int bufsz = (sizeof(struct reply_tx_error_statistics) * 24) + 200;
+       int bufsz = (sizeof(struct reply_tx_error_statistics) * 24) +
+               (sizeof(struct reply_agg_tx_error_statistics) * 24) + 200;
        ssize_t ret;
 
        if (!iwl_is_alive(priv))
@@ -1104,6 +1105,52 @@ ssize_t iwl_reply_tx_error_read(struct file *file,
        pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n",
                         priv->_agn.reply_tx_stats.unknown);
 
+       pos += scnprintf(buf + pos, bufsz - pos,
+                        "\nStatistics_Agg_TX_Error:\n");
+
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_UNDERRUN_MSK),
+                        priv->_agn.reply_agg_tx_stats.underrun);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_BT_PRIO_MSK),
+                        priv->_agn.reply_agg_tx_stats.bt_prio);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_FEW_BYTES_MSK),
+                        priv->_agn.reply_agg_tx_stats.few_bytes);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_ABORT_MSK),
+                        priv->_agn.reply_agg_tx_stats.abort);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(
+                               AGG_TX_STATE_LAST_SENT_TTL_MSK),
+                        priv->_agn.reply_agg_tx_stats.last_sent_ttl);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(
+                               AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK),
+                        priv->_agn.reply_agg_tx_stats.last_sent_try);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(
+                               AGG_TX_STATE_LAST_SENT_BT_KILL_MSK),
+                        priv->_agn.reply_agg_tx_stats.last_sent_bt_kill);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_SCD_QUERY_MSK),
+                        priv->_agn.reply_agg_tx_stats.scd_query);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(
+                               AGG_TX_STATE_TEST_BAD_CRC32_MSK),
+                        priv->_agn.reply_agg_tx_stats.bad_crc32);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_RESPONSE_MSK),
+                        priv->_agn.reply_agg_tx_stats.response);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_DUMP_TX_MSK),
+                        priv->_agn.reply_agg_tx_stats.dump_tx);
+       pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n",
+                        iwl_get_agg_tx_fail_reason(AGG_TX_STATE_DELAY_TX_MSK),
+                        priv->_agn.reply_agg_tx_stats.delay_tx);
+       pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n",
+                        priv->_agn.reply_agg_tx_stats.unknown);
+
        ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
        kfree(buf);
        return ret;
index e1f85ae9da59a4ff1dab2124d1f758fa18546fc9..a372184ac2105b4761d71514abdcd5076d7839ff 100644 (file)
@@ -238,4 +238,9 @@ void iwlagn_bt_rx_handler_setup(struct iwl_priv *priv);
 void iwlagn_bt_setup_deferred_work(struct iwl_priv *priv);
 void iwlagn_bt_cancel_deferred_work(struct iwl_priv *priv);
 
+#ifdef CONFIG_IWLWIFI_DEBUG
+const char *iwl_get_agg_tx_fail_reason(u16 status);
+#else
+static inline const char *iwl_get_agg_tx_fail_reason(u16 status) { return ""; }
+#endif
 #endif /* __iwl_agn_h__ */