]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
iwlwifi: dvm: improve (again) the prints in reclaim path
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 14 Feb 2013 09:33:54 +0000 (11:33 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 18 Feb 2013 19:19:25 +0000 (20:19 +0100)
I removed a bit too much info last time.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/dvm/commands.h
drivers/net/wireless/iwlwifi/dvm/tx.c

index 02c9ebb3b340bedff189a11785e032ebb4a540cc..84e2c0fcfef6053af57ef3c8ee0bca6468d79725 100644 (file)
@@ -1403,6 +1403,7 @@ enum {
 
 #define AGG_TX_STATUS_MSK      0x00000fff      /* bits 0:11 */
 #define AGG_TX_TRY_MSK         0x0000f000      /* bits 12:15 */
+#define AGG_TX_TRY_POS         12
 
 #define AGG_TX_STATE_LAST_SENT_MSK  (AGG_TX_STATE_LAST_SENT_TTL_MSK | \
                                     AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \
index d1dccb361391b6f2318fcc20d58cd228a7e2e02c..6aec2df3bb27768fcfbcb5555384746a9e5026ec 100644 (file)
@@ -908,6 +908,12 @@ static void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status)
        }
 }
 
+static inline u32 iwlagn_get_scd_ssn(struct iwlagn_tx_resp *tx_resp)
+{
+       return le32_to_cpup((__le32 *)&tx_resp->status +
+                           tx_resp->frame_count) & MAX_SN;
+}
+
 static void iwl_rx_reply_tx_agg(struct iwl_priv *priv,
                                struct iwlagn_tx_resp *tx_resp)
 {
@@ -942,9 +948,15 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv,
        if (tx_resp->frame_count == 1)
                return;
 
+       IWL_DEBUG_TX_REPLY(priv, "TXQ %d initial_rate 0x%x ssn %d frm_cnt %d\n",
+                          agg->txq_id,
+                          le32_to_cpu(tx_resp->rate_n_flags),
+                          iwlagn_get_scd_ssn(tx_resp), tx_resp->frame_count);
+
        /* Construct bit-map of pending frames within Tx window */
        for (i = 0; i < tx_resp->frame_count; i++) {
                u16 fstatus = le16_to_cpu(frame_status[i].status);
+               u8 retry_cnt = (fstatus & AGG_TX_TRY_MSK) >> AGG_TX_TRY_POS;
 
                if (status & AGG_TX_STATUS_MSK)
                        iwlagn_count_agg_tx_err_status(priv, fstatus);
@@ -952,6 +964,14 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv,
                if (status & (AGG_TX_STATE_FEW_BYTES_MSK |
                              AGG_TX_STATE_ABORT_MSK))
                        continue;
+
+               if (status & AGG_TX_STATUS_MSK || retry_cnt > 1)
+                       IWL_DEBUG_TX_REPLY(priv,
+                                          "%d: status %s (0x%04x), try-count (0x%01x)\n",
+                                          i,
+                                          iwl_get_agg_tx_fail_reason(fstatus),
+                                          fstatus & AGG_TX_STATUS_MSK,
+                                          retry_cnt);
        }
 }
 
@@ -982,12 +1002,6 @@ const char *iwl_get_agg_tx_fail_reason(u16 status)
 }
 #endif /* CONFIG_IWLWIFI_DEBUG */
 
-static inline u32 iwlagn_get_scd_ssn(struct iwlagn_tx_resp *tx_resp)
-{
-       return le32_to_cpup((__le32 *)&tx_resp->status +
-                           tx_resp->frame_count) & MAX_SN;
-}
-
 static void iwlagn_count_tx_err_status(struct iwl_priv *priv, u16 status)
 {
        status &= TX_STATUS_MSK;
@@ -1119,8 +1133,14 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
 
        spin_lock_bh(&priv->sta_lock);
 
-       if (is_agg)
+       if (is_agg) {
+               WARN_ON_ONCE(sta_id >= IWLAGN_STATION_COUNT ||
+                            tid >= IWL_MAX_TID_COUNT);
+               if (txq_id != priv->tid_data[sta_id][tid].agg.txq_id)
+                       IWL_ERR(priv, "txq_id mismatch: %d %d\n", txq_id,
+                               priv->tid_data[sta_id][tid].agg.txq_id);
                iwl_rx_reply_tx_agg(priv, tx_resp);
+       }
 
        __skb_queue_head_init(&skbs);
 
@@ -1224,16 +1244,17 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
                 */
                if (is_offchannel_skb && freed != 1)
                        IWL_ERR(priv, "OFFCHANNEL SKB freed %d\n", freed);
-       }
 
-       IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x)\n", txq_id,
-                          iwl_get_tx_fail_reason(status), status);
+               IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x)\n", txq_id,
+                                  iwl_get_tx_fail_reason(status), status);
 
-       IWL_DEBUG_TX_REPLY(priv,
-                          "\t\t\t\tinitial_rate 0x%x retries %d, idx=%d ssn=%d seq_ctl=0x%x\n",
-                          le32_to_cpu(tx_resp->rate_n_flags),
-                          tx_resp->failure_frame, SEQ_TO_INDEX(sequence), ssn,
-                          le16_to_cpu(tx_resp->seq_ctl));
+               IWL_DEBUG_TX_REPLY(priv,
+                                  "\t\t\t\tinitial_rate 0x%x retries %d, idx=%d ssn=%d seq_ctl=0x%x\n",
+                                  le32_to_cpu(tx_resp->rate_n_flags),
+                                  tx_resp->failure_frame,
+                                  SEQ_TO_INDEX(sequence), ssn,
+                                  le16_to_cpu(tx_resp->seq_ctl));
+       }
 
        iwl_check_abort_status(priv, tx_resp->frame_count, status);
        spin_unlock_bh(&priv->sta_lock);