diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-03-16 13:46:31 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-03-25 14:16:37 -0400 |
commit | 872c8ddcbec06995c1c7caa3e41c921290a8b6df (patch) | |
tree | 15aebc3465235e7d35c41f9f2470221b957fab71 /drivers/net/wireless | |
parent | e184f67d39f681b1e8c9a43ff7001c3405c2bd7c (diff) |
iwlwifi: iwl_good_ack_health() only apply to AGN device
iwl_good_ack_health() check for expected and actual ack count which only
apply to aggregation mode. Move the function to iwlagn module.
Reported-by: Chantry Xavier <chantry.xavier@gmail.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 54 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 55 |
3 files changed, 56 insertions, 55 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index e69e6256a41b..680e897b92db 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1417,6 +1417,60 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
1417 | iwl_enable_interrupts(priv); | 1417 | iwl_enable_interrupts(priv); |
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | /* the threshold ratio of actual_ack_cnt to expected_ack_cnt in percent */ | ||
1421 | #define ACK_CNT_RATIO (50) | ||
1422 | #define BA_TIMEOUT_CNT (5) | ||
1423 | #define BA_TIMEOUT_MAX (16) | ||
1424 | |||
1425 | /** | ||
1426 | * iwl_good_ack_health - checks for ACK count ratios, BA timeout retries. | ||
1427 | * | ||
1428 | * When the ACK count ratio is 0 and aggregated BA timeout retries exceeding | ||
1429 | * the BA_TIMEOUT_MAX, reload firmware and bring system back to normal | ||
1430 | * operation state. | ||
1431 | */ | ||
1432 | bool iwl_good_ack_health(struct iwl_priv *priv, | ||
1433 | struct iwl_rx_packet *pkt) | ||
1434 | { | ||
1435 | bool rc = true; | ||
1436 | int actual_ack_cnt_delta, expected_ack_cnt_delta; | ||
1437 | int ba_timeout_delta; | ||
1438 | |||
1439 | actual_ack_cnt_delta = | ||
1440 | le32_to_cpu(pkt->u.stats.tx.actual_ack_cnt) - | ||
1441 | le32_to_cpu(priv->statistics.tx.actual_ack_cnt); | ||
1442 | expected_ack_cnt_delta = | ||
1443 | le32_to_cpu(pkt->u.stats.tx.expected_ack_cnt) - | ||
1444 | le32_to_cpu(priv->statistics.tx.expected_ack_cnt); | ||
1445 | ba_timeout_delta = | ||
1446 | le32_to_cpu(pkt->u.stats.tx.agg.ba_timeout) - | ||
1447 | le32_to_cpu(priv->statistics.tx.agg.ba_timeout); | ||
1448 | if ((priv->_agn.agg_tids_count > 0) && | ||
1449 | (expected_ack_cnt_delta > 0) && | ||
1450 | (((actual_ack_cnt_delta * 100) / expected_ack_cnt_delta) | ||
1451 | < ACK_CNT_RATIO) && | ||
1452 | (ba_timeout_delta > BA_TIMEOUT_CNT)) { | ||
1453 | IWL_DEBUG_RADIO(priv, "actual_ack_cnt delta = %d," | ||
1454 | " expected_ack_cnt = %d\n", | ||
1455 | actual_ack_cnt_delta, expected_ack_cnt_delta); | ||
1456 | |||
1457 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1458 | IWL_DEBUG_RADIO(priv, "rx_detected_cnt delta = %d\n", | ||
1459 | priv->delta_statistics.tx.rx_detected_cnt); | ||
1460 | IWL_DEBUG_RADIO(priv, | ||
1461 | "ack_or_ba_timeout_collision delta = %d\n", | ||
1462 | priv->delta_statistics.tx. | ||
1463 | ack_or_ba_timeout_collision); | ||
1464 | #endif | ||
1465 | IWL_DEBUG_RADIO(priv, "agg ba_timeout delta = %d\n", | ||
1466 | ba_timeout_delta); | ||
1467 | if (!actual_ack_cnt_delta && | ||
1468 | (ba_timeout_delta >= BA_TIMEOUT_MAX)) | ||
1469 | rc = false; | ||
1470 | } | ||
1471 | return rc; | ||
1472 | } | ||
1473 | |||
1420 | 1474 | ||
1421 | /****************************************************************************** | 1475 | /****************************************************************************** |
1422 | * | 1476 | * |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 26eeb586ee00..42c291b12546 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -70,5 +70,7 @@ void iwl_disable_ict(struct iwl_priv *priv); | |||
70 | int iwl_alloc_isr_ict(struct iwl_priv *priv); | 70 | int iwl_alloc_isr_ict(struct iwl_priv *priv); |
71 | void iwl_free_isr_ict(struct iwl_priv *priv); | 71 | void iwl_free_isr_ict(struct iwl_priv *priv); |
72 | irqreturn_t iwl_isr_ict(int irq, void *data); | 72 | irqreturn_t iwl_isr_ict(int irq, void *data); |
73 | bool iwl_good_ack_health(struct iwl_priv *priv, | ||
74 | struct iwl_rx_packet *pkt); | ||
73 | 75 | ||
74 | #endif /* __iwl_agn_h__ */ | 76 | #endif /* __iwl_agn_h__ */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index b6a64d83718a..de453f25f1c9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -616,61 +616,6 @@ static void iwl_accumulative_statistics(struct iwl_priv *priv, | |||
616 | 616 | ||
617 | #define REG_RECALIB_PERIOD (60) | 617 | #define REG_RECALIB_PERIOD (60) |
618 | 618 | ||
619 | /* the threshold ratio of actual_ack_cnt to expected_ack_cnt in percent */ | ||
620 | #define ACK_CNT_RATIO (50) | ||
621 | #define BA_TIMEOUT_CNT (5) | ||
622 | #define BA_TIMEOUT_MAX (16) | ||
623 | |||
624 | /** | ||
625 | * iwl_good_ack_health - checks for ACK count ratios, BA timeout retries. | ||
626 | * | ||
627 | * When the ACK count ratio is 0 and aggregated BA timeout retries exceeding | ||
628 | * the BA_TIMEOUT_MAX, reload firmware and bring system back to normal | ||
629 | * operation state. | ||
630 | */ | ||
631 | bool iwl_good_ack_health(struct iwl_priv *priv, | ||
632 | struct iwl_rx_packet *pkt) | ||
633 | { | ||
634 | bool rc = true; | ||
635 | int actual_ack_cnt_delta, expected_ack_cnt_delta; | ||
636 | int ba_timeout_delta; | ||
637 | |||
638 | actual_ack_cnt_delta = | ||
639 | le32_to_cpu(pkt->u.stats.tx.actual_ack_cnt) - | ||
640 | le32_to_cpu(priv->statistics.tx.actual_ack_cnt); | ||
641 | expected_ack_cnt_delta = | ||
642 | le32_to_cpu(pkt->u.stats.tx.expected_ack_cnt) - | ||
643 | le32_to_cpu(priv->statistics.tx.expected_ack_cnt); | ||
644 | ba_timeout_delta = | ||
645 | le32_to_cpu(pkt->u.stats.tx.agg.ba_timeout) - | ||
646 | le32_to_cpu(priv->statistics.tx.agg.ba_timeout); | ||
647 | if ((priv->_agn.agg_tids_count > 0) && | ||
648 | (expected_ack_cnt_delta > 0) && | ||
649 | (((actual_ack_cnt_delta * 100) / expected_ack_cnt_delta) | ||
650 | < ACK_CNT_RATIO) && | ||
651 | (ba_timeout_delta > BA_TIMEOUT_CNT)) { | ||
652 | IWL_DEBUG_RADIO(priv, "actual_ack_cnt delta = %d," | ||
653 | " expected_ack_cnt = %d\n", | ||
654 | actual_ack_cnt_delta, expected_ack_cnt_delta); | ||
655 | |||
656 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
657 | IWL_DEBUG_RADIO(priv, "rx_detected_cnt delta = %d\n", | ||
658 | priv->delta_statistics.tx.rx_detected_cnt); | ||
659 | IWL_DEBUG_RADIO(priv, | ||
660 | "ack_or_ba_timeout_collision delta = %d\n", | ||
661 | priv->delta_statistics.tx. | ||
662 | ack_or_ba_timeout_collision); | ||
663 | #endif | ||
664 | IWL_DEBUG_RADIO(priv, "agg ba_timeout delta = %d\n", | ||
665 | ba_timeout_delta); | ||
666 | if (!actual_ack_cnt_delta && | ||
667 | (ba_timeout_delta >= BA_TIMEOUT_MAX)) | ||
668 | rc = false; | ||
669 | } | ||
670 | return rc; | ||
671 | } | ||
672 | EXPORT_SYMBOL(iwl_good_ack_health); | ||
673 | |||
674 | /** | 619 | /** |
675 | * iwl_good_plcp_health - checks for plcp error. | 620 | * iwl_good_plcp_health - checks for plcp error. |
676 | * | 621 | * |