diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-22 12:02:02 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-10-07 18:50:48 -0400 |
commit | 69fdb710b29d096bc50123f7c97891e31ffe45f9 (patch) | |
tree | 8c8575274e648498ad3a16e2a66d1fa27f71f684 | |
parent | a30e3112a8bcb5bc1caa48547e597de3992e1b21 (diff) |
iwlwifi: move tx fail code to agn
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>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 40 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 38 |
4 files changed, 42 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index 77753b72f23..db57aea629d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -1391,3 +1391,43 @@ void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
1391 | 1391 | ||
1392 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 1392 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
1393 | } | 1393 | } |
1394 | |||
1395 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1396 | const char *iwl_get_tx_fail_reason(u32 status) | ||
1397 | { | ||
1398 | #define TX_STATUS_FAIL(x) case TX_STATUS_FAIL_ ## x: return #x | ||
1399 | #define TX_STATUS_POSTPONE(x) case TX_STATUS_POSTPONE_ ## x: return #x | ||
1400 | |||
1401 | switch (status & TX_STATUS_MSK) { | ||
1402 | case TX_STATUS_SUCCESS: | ||
1403 | return "SUCCESS"; | ||
1404 | TX_STATUS_POSTPONE(DELAY); | ||
1405 | TX_STATUS_POSTPONE(FEW_BYTES); | ||
1406 | TX_STATUS_POSTPONE(BT_PRIO); | ||
1407 | TX_STATUS_POSTPONE(QUIET_PERIOD); | ||
1408 | TX_STATUS_POSTPONE(CALC_TTAK); | ||
1409 | TX_STATUS_FAIL(INTERNAL_CROSSED_RETRY); | ||
1410 | TX_STATUS_FAIL(SHORT_LIMIT); | ||
1411 | TX_STATUS_FAIL(LONG_LIMIT); | ||
1412 | TX_STATUS_FAIL(FIFO_UNDERRUN); | ||
1413 | TX_STATUS_FAIL(DRAIN_FLOW); | ||
1414 | TX_STATUS_FAIL(RFKILL_FLUSH); | ||
1415 | TX_STATUS_FAIL(LIFE_EXPIRE); | ||
1416 | TX_STATUS_FAIL(DEST_PS); | ||
1417 | TX_STATUS_FAIL(HOST_ABORTED); | ||
1418 | TX_STATUS_FAIL(BT_RETRY); | ||
1419 | TX_STATUS_FAIL(STA_INVALID); | ||
1420 | TX_STATUS_FAIL(FRAG_DROPPED); | ||
1421 | TX_STATUS_FAIL(TID_DISABLE); | ||
1422 | TX_STATUS_FAIL(FIFO_FLUSHED); | ||
1423 | TX_STATUS_FAIL(INSUFFICIENT_CF_POLL); | ||
1424 | TX_STATUS_FAIL(PASSIVE_NO_RX); | ||
1425 | TX_STATUS_FAIL(NO_BEACON_ON_RADAR); | ||
1426 | } | ||
1427 | |||
1428 | return "UNKNOWN"; | ||
1429 | |||
1430 | #undef TX_STATUS_FAIL | ||
1431 | #undef TX_STATUS_POSTPONE | ||
1432 | } | ||
1433 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 632ea4ba82b..d6645ec9ec5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -248,8 +248,10 @@ void iwlagn_bt_setup_deferred_work(struct iwl_priv *priv); | |||
248 | void iwlagn_bt_cancel_deferred_work(struct iwl_priv *priv); | 248 | void iwlagn_bt_cancel_deferred_work(struct iwl_priv *priv); |
249 | 249 | ||
250 | #ifdef CONFIG_IWLWIFI_DEBUG | 250 | #ifdef CONFIG_IWLWIFI_DEBUG |
251 | const char *iwl_get_tx_fail_reason(u32 status); | ||
251 | const char *iwl_get_agg_tx_fail_reason(u16 status); | 252 | const char *iwl_get_agg_tx_fail_reason(u16 status); |
252 | #else | 253 | #else |
254 | static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; } | ||
253 | static inline const char *iwl_get_agg_tx_fail_reason(u16 status) { return ""; } | 255 | static inline const char *iwl_get_agg_tx_fail_reason(u16 status) { return ""; } |
254 | #endif | 256 | #endif |
255 | 257 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 90a37a94c69..2b04714c3a9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1566,7 +1566,6 @@ static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id) | |||
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | #ifdef CONFIG_IWLWIFI_DEBUG | 1568 | #ifdef CONFIG_IWLWIFI_DEBUG |
1569 | const char *iwl_get_tx_fail_reason(u32 status); | ||
1570 | /* | 1569 | /* |
1571 | * iwl_get_debug_level: Return active debug level for device | 1570 | * iwl_get_debug_level: Return active debug level for device |
1572 | * | 1571 | * |
@@ -1582,8 +1581,6 @@ static inline u32 iwl_get_debug_level(struct iwl_priv *priv) | |||
1582 | return iwl_debug_level; | 1581 | return iwl_debug_level; |
1583 | } | 1582 | } |
1584 | #else | 1583 | #else |
1585 | static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; } | ||
1586 | |||
1587 | static inline u32 iwl_get_debug_level(struct iwl_priv *priv) | 1584 | static inline u32 iwl_get_debug_level(struct iwl_priv *priv) |
1588 | { | 1585 | { |
1589 | return iwl_debug_level; | 1586 | return iwl_debug_level; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 3290b1552f5..7261ee49f28 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -636,41 +636,3 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
636 | meta->flags = 0; | 636 | meta->flags = 0; |
637 | } | 637 | } |
638 | EXPORT_SYMBOL(iwl_tx_cmd_complete); | 638 | EXPORT_SYMBOL(iwl_tx_cmd_complete); |
639 | |||
640 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
641 | #define TX_STATUS_FAIL(x) case TX_STATUS_FAIL_ ## x: return #x | ||
642 | #define TX_STATUS_POSTPONE(x) case TX_STATUS_POSTPONE_ ## x: return #x | ||
643 | |||
644 | const char *iwl_get_tx_fail_reason(u32 status) | ||
645 | { | ||
646 | switch (status & TX_STATUS_MSK) { | ||
647 | case TX_STATUS_SUCCESS: | ||
648 | return "SUCCESS"; | ||
649 | TX_STATUS_POSTPONE(DELAY); | ||
650 | TX_STATUS_POSTPONE(FEW_BYTES); | ||
651 | TX_STATUS_POSTPONE(BT_PRIO); | ||
652 | TX_STATUS_POSTPONE(QUIET_PERIOD); | ||
653 | TX_STATUS_POSTPONE(CALC_TTAK); | ||
654 | TX_STATUS_FAIL(INTERNAL_CROSSED_RETRY); | ||
655 | TX_STATUS_FAIL(SHORT_LIMIT); | ||
656 | TX_STATUS_FAIL(LONG_LIMIT); | ||
657 | TX_STATUS_FAIL(FIFO_UNDERRUN); | ||
658 | TX_STATUS_FAIL(DRAIN_FLOW); | ||
659 | TX_STATUS_FAIL(RFKILL_FLUSH); | ||
660 | TX_STATUS_FAIL(LIFE_EXPIRE); | ||
661 | TX_STATUS_FAIL(DEST_PS); | ||
662 | TX_STATUS_FAIL(HOST_ABORTED); | ||
663 | TX_STATUS_FAIL(BT_RETRY); | ||
664 | TX_STATUS_FAIL(STA_INVALID); | ||
665 | TX_STATUS_FAIL(FRAG_DROPPED); | ||
666 | TX_STATUS_FAIL(TID_DISABLE); | ||
667 | TX_STATUS_FAIL(FIFO_FLUSHED); | ||
668 | TX_STATUS_FAIL(INSUFFICIENT_CF_POLL); | ||
669 | TX_STATUS_FAIL(PASSIVE_NO_RX); | ||
670 | TX_STATUS_FAIL(NO_BEACON_ON_RADAR); | ||
671 | } | ||
672 | |||
673 | return "UNKNOWN"; | ||
674 | } | ||
675 | EXPORT_SYMBOL(iwl_get_tx_fail_reason); | ||
676 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||