iwlagn: keep track of aggregated tx frames failure counter
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Sun, 5 Sep 2010 17:49:44 +0000 (10:49 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 17 Sep 2010 20:18:02 +0000 (13:18 -0700)
When uCode completed the aggregated frames transmission attempt,
it will send tx command response with aggregated frame status.

Keep track of the failure counter which help indicate any transmission
error condition.

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

index a8494d0e285a7207e333fdc69e5c33ee7dbda3bc..c42cb18de833274e688afe534b256e7e0d2aef67 100644 (file)
@@ -123,6 +123,53 @@ static void iwlagn_count_tx_err_status(struct iwl_priv *priv, u16 status)
        }
 }
 
+static void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status)
+{
+       status &= AGG_TX_STATUS_MSK;
+
+       switch (status) {
+       case AGG_TX_STATE_UNDERRUN_MSK:
+               priv->_agn.reply_agg_tx_stats.underrun++;
+               break;
+       case AGG_TX_STATE_BT_PRIO_MSK:
+               priv->_agn.reply_agg_tx_stats.bt_prio++;
+               break;
+       case AGG_TX_STATE_FEW_BYTES_MSK:
+               priv->_agn.reply_agg_tx_stats.few_bytes++;
+               break;
+       case AGG_TX_STATE_ABORT_MSK:
+               priv->_agn.reply_agg_tx_stats.abort++;
+               break;
+       case AGG_TX_STATE_LAST_SENT_TTL_MSK:
+               priv->_agn.reply_agg_tx_stats.last_sent_ttl++;
+               break;
+       case AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK:
+               priv->_agn.reply_agg_tx_stats.last_sent_try++;
+               break;
+       case AGG_TX_STATE_LAST_SENT_BT_KILL_MSK:
+               priv->_agn.reply_agg_tx_stats.last_sent_bt_kill++;
+               break;
+       case AGG_TX_STATE_SCD_QUERY_MSK:
+               priv->_agn.reply_agg_tx_stats.scd_query++;
+               break;
+       case AGG_TX_STATE_TEST_BAD_CRC32_MSK:
+               priv->_agn.reply_agg_tx_stats.bad_crc32++;
+               break;
+       case AGG_TX_STATE_RESPONSE_MSK:
+               priv->_agn.reply_agg_tx_stats.response++;
+               break;
+       case AGG_TX_STATE_DUMP_TX_MSK:
+               priv->_agn.reply_agg_tx_stats.dump_tx++;
+               break;
+       case AGG_TX_STATE_DELAY_TX_MSK:
+               priv->_agn.reply_agg_tx_stats.delay_tx++;
+               break;
+       default:
+               priv->_agn.reply_agg_tx_stats.unknown++;
+               break;
+       }
+}
+
 static void iwlagn_set_tx_status(struct iwl_priv *priv,
                                 struct ieee80211_tx_info *info,
                                 struct iwl5000_tx_resp *tx_resp,
@@ -224,6 +271,9 @@ static int iwlagn_tx_status_reply_tx(struct iwl_priv *priv,
                        idx = SEQ_TO_INDEX(seq);
                        txq_id = SEQ_TO_QUEUE(seq);
 
+                       if (status & AGG_TX_STATUS_MSK)
+                               iwlagn_count_agg_tx_err_status(priv, status);
+
                        if (status & (AGG_TX_STATE_FEW_BYTES_MSK |
                                      AGG_TX_STATE_ABORT_MSK))
                                continue;
index bfa4864ec6d3674691dc4e21660ac3ef90a69fd4..74d25bcbfcb27e7532c9facc8e05600760bc4593 100644 (file)
@@ -984,6 +984,23 @@ struct reply_tx_error_statistics {
        u32 unknown;
 };
 
+/* reply_agg_tx_statistics (for _agn devices) */
+struct reply_agg_tx_error_statistics {
+       u32 underrun;
+       u32 bt_prio;
+       u32 few_bytes;
+       u32 abort;
+       u32 last_sent_ttl;
+       u32 last_sent_try;
+       u32 last_sent_bt_kill;
+       u32 scd_query;
+       u32 bad_crc32;
+       u32 response;
+       u32 dump_tx;
+       u32 delay_tx;
+       u32 unknown;
+};
+
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 /* management statistics */
 enum iwl_mgmt_stats {
@@ -1444,6 +1461,7 @@ struct iwl_priv {
                        struct iwl_bt_notif_statistics statistics_bt;
                        /* counts reply_tx error */
                        struct reply_tx_error_statistics reply_tx_stats;
+                       struct reply_agg_tx_error_statistics reply_agg_tx_stats;
 #ifdef CONFIG_IWLWIFI_DEBUGFS
                        struct iwl_notif_statistics accum_statistics;
                        struct iwl_notif_statistics delta_statistics;