iwlwifi: move tx fail code to agn
authorJohannes Berg <johannes.berg@intel.com>
Wed, 22 Sep 2010 16:02:02 +0000 (18:02 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 7 Oct 2010 22:50:48 +0000 (15:50 -0700)
The code to print out TX failure reasons is
AGN specific, so it can be in the AGN module.

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

index 77753b72f23680b36677fad7fc271d2e0cd52017..db57aea629d93857e6a3b068ce74059b87c0d771 100644 (file)
@@ -1391,3 +1391,43 @@ void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
 
        spin_unlock_irqrestore(&priv->sta_lock, flags);
 }
+
+#ifdef CONFIG_IWLWIFI_DEBUG
+const char *iwl_get_tx_fail_reason(u32 status)
+{
+#define TX_STATUS_FAIL(x) case TX_STATUS_FAIL_ ## x: return #x
+#define TX_STATUS_POSTPONE(x) case TX_STATUS_POSTPONE_ ## x: return #x
+
+       switch (status & TX_STATUS_MSK) {
+       case TX_STATUS_SUCCESS:
+               return "SUCCESS";
+       TX_STATUS_POSTPONE(DELAY);
+       TX_STATUS_POSTPONE(FEW_BYTES);
+       TX_STATUS_POSTPONE(BT_PRIO);
+       TX_STATUS_POSTPONE(QUIET_PERIOD);
+       TX_STATUS_POSTPONE(CALC_TTAK);
+       TX_STATUS_FAIL(INTERNAL_CROSSED_RETRY);
+       TX_STATUS_FAIL(SHORT_LIMIT);
+       TX_STATUS_FAIL(LONG_LIMIT);
+       TX_STATUS_FAIL(FIFO_UNDERRUN);
+       TX_STATUS_FAIL(DRAIN_FLOW);
+       TX_STATUS_FAIL(RFKILL_FLUSH);
+       TX_STATUS_FAIL(LIFE_EXPIRE);
+       TX_STATUS_FAIL(DEST_PS);
+       TX_STATUS_FAIL(HOST_ABORTED);
+       TX_STATUS_FAIL(BT_RETRY);
+       TX_STATUS_FAIL(STA_INVALID);
+       TX_STATUS_FAIL(FRAG_DROPPED);
+       TX_STATUS_FAIL(TID_DISABLE);
+       TX_STATUS_FAIL(FIFO_FLUSHED);
+       TX_STATUS_FAIL(INSUFFICIENT_CF_POLL);
+       TX_STATUS_FAIL(PASSIVE_NO_RX);
+       TX_STATUS_FAIL(NO_BEACON_ON_RADAR);
+       }
+
+       return "UNKNOWN";
+
+#undef TX_STATUS_FAIL
+#undef TX_STATUS_POSTPONE
+}
+#endif /* CONFIG_IWLWIFI_DEBUG */
index 632ea4ba82bb297ae29f9a010fc1cb9fb4df2540..d6645ec9ec5b9d6aa1ab7a5bd1640333f1dc2df7 100644 (file)
@@ -248,8 +248,10 @@ 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_tx_fail_reason(u32 status);
 const char *iwl_get_agg_tx_fail_reason(u16 status);
 #else
+static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
 static inline const char *iwl_get_agg_tx_fail_reason(u16 status) { return ""; }
 #endif
 
index 90a37a94c69876c034ba168437fb764912445ef3..2b04714c3a9cbc3780e6f4d9f1d32062dd86b463 100644 (file)
@@ -1566,7 +1566,6 @@ static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id)
 }
 
 #ifdef CONFIG_IWLWIFI_DEBUG
-const char *iwl_get_tx_fail_reason(u32 status);
 /*
  * iwl_get_debug_level: Return active debug level for device
  *
@@ -1582,8 +1581,6 @@ static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
                return iwl_debug_level;
 }
 #else
-static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
-
 static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
 {
        return iwl_debug_level;
index 3290b1552f5a8dd9f035ff5b09af51348369fed2..7261ee49f282f2c1e3a6d027a2aad2954c9b85a3 100644 (file)
@@ -636,41 +636,3 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
        meta->flags = 0;
 }
 EXPORT_SYMBOL(iwl_tx_cmd_complete);
-
-#ifdef CONFIG_IWLWIFI_DEBUG
-#define TX_STATUS_FAIL(x) case TX_STATUS_FAIL_ ## x: return #x
-#define TX_STATUS_POSTPONE(x) case TX_STATUS_POSTPONE_ ## x: return #x
-
-const char *iwl_get_tx_fail_reason(u32 status)
-{
-       switch (status & TX_STATUS_MSK) {
-       case TX_STATUS_SUCCESS:
-               return "SUCCESS";
-               TX_STATUS_POSTPONE(DELAY);
-               TX_STATUS_POSTPONE(FEW_BYTES);
-               TX_STATUS_POSTPONE(BT_PRIO);
-               TX_STATUS_POSTPONE(QUIET_PERIOD);
-               TX_STATUS_POSTPONE(CALC_TTAK);
-               TX_STATUS_FAIL(INTERNAL_CROSSED_RETRY);
-               TX_STATUS_FAIL(SHORT_LIMIT);
-               TX_STATUS_FAIL(LONG_LIMIT);
-               TX_STATUS_FAIL(FIFO_UNDERRUN);
-               TX_STATUS_FAIL(DRAIN_FLOW);
-               TX_STATUS_FAIL(RFKILL_FLUSH);
-               TX_STATUS_FAIL(LIFE_EXPIRE);
-               TX_STATUS_FAIL(DEST_PS);
-               TX_STATUS_FAIL(HOST_ABORTED);
-               TX_STATUS_FAIL(BT_RETRY);
-               TX_STATUS_FAIL(STA_INVALID);
-               TX_STATUS_FAIL(FRAG_DROPPED);
-               TX_STATUS_FAIL(TID_DISABLE);
-               TX_STATUS_FAIL(FIFO_FLUSHED);
-               TX_STATUS_FAIL(INSUFFICIENT_CF_POLL);
-               TX_STATUS_FAIL(PASSIVE_NO_RX);
-               TX_STATUS_FAIL(NO_BEACON_ON_RADAR);
-       }
-
-       return "UNKNOWN";
-}
-EXPORT_SYMBOL(iwl_get_tx_fail_reason);
-#endif /* CONFIG_IWLWIFI_DEBUG */