linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] iwlwifi: cleanup iwl_recover_from_statistics
@ 2011-02-08  8:31 Stanislaw Gruszka
  2011-02-08  8:31 ` [PATCH 2/5] iwlwifi: cleanup {iwl,iwl3945}_good_plcp_health Stanislaw Gruszka
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Stanislaw Gruszka @ 2011-02-08  8:31 UTC (permalink / raw)
  To: Wey-Yi Guy, Intel Linux Wireless; +Cc: linux-wireless, Stanislaw Gruszka

No functional change, make recover from statistics code
easies to read.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl-rx.c |   37 ++++++++++----------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 87a6fd8..bc89393 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -234,33 +234,20 @@ EXPORT_SYMBOL(iwl_rx_spectrum_measure_notif);
 void iwl_recover_from_statistics(struct iwl_priv *priv,
 				struct iwl_rx_packet *pkt)
 {
-	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+	if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
+	    !iwl_is_any_associated(priv))
 		return;
-	if (iwl_is_any_associated(priv)) {
-		if (priv->cfg->ops->lib->check_ack_health) {
-			if (!priv->cfg->ops->lib->check_ack_health(
-			    priv, pkt)) {
-				/*
-				 * low ack count detected
-				 * restart Firmware
-				 */
-				IWL_ERR(priv, "low ack count detected, "
-					"restart firmware\n");
-				if (!iwl_force_reset(priv, IWL_FW_RESET, false))
-					return;
-			}
-		}
-		if (priv->cfg->ops->lib->check_plcp_health) {
-			if (!priv->cfg->ops->lib->check_plcp_health(
-			    priv, pkt)) {
-				/*
-				 * high plcp error detected
-				 * reset Radio
-				 */
-				iwl_force_reset(priv, IWL_RF_RESET, false);
-			}
-		}
+
+	if (priv->cfg->ops->lib->check_ack_health &&
+	    !priv->cfg->ops->lib->check_ack_health(priv, pkt)) {
+		IWL_ERR(priv, "low ack count detected, restart firmware\n");
+		if (!iwl_force_reset(priv, IWL_FW_RESET, false))
+			return;
 	}
+
+	if (priv->cfg->ops->lib->check_plcp_health &&
+	    !priv->cfg->ops->lib->check_plcp_health(priv, pkt))
+		iwl_force_reset(priv, IWL_RF_RESET, false);
 }
 EXPORT_SYMBOL(iwl_recover_from_statistics);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-02-09 17:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-08  8:31 [PATCH 1/5] iwlwifi: cleanup iwl_recover_from_statistics Stanislaw Gruszka
2011-02-08  8:31 ` [PATCH 2/5] iwlwifi: cleanup {iwl,iwl3945}_good_plcp_health Stanislaw Gruszka
2011-02-08 15:24   ` wwguy
2011-02-09  6:24     ` Stanislaw Gruszka
2011-02-09 17:03       ` wwguy
2011-02-08  8:31 ` [PATCH 3/5] iwlwifi: cleanup iwl_good_ack_health Stanislaw Gruszka
2011-02-08 15:32   ` wwguy
2011-02-08  8:31 ` [PATCH 4/5] iwlwifi: fix ack health for WiFi/BT combo devices Stanislaw Gruszka
2011-02-08 15:36   ` wwguy
2011-02-09  6:26     ` Stanislaw Gruszka
2011-02-09 17:04       ` wwguy
2011-02-08  8:31 ` [PATCH 5/5] iwlwifi: avoid too frequent recover from statistics Stanislaw Gruszka
2011-02-08 15:45   ` wwguy
2011-02-09  6:28     ` Stanislaw Gruszka
2011-02-09 17:05       ` wwguy
2011-02-08 15:16 ` [PATCH 1/5] iwlwifi: cleanup iwl_recover_from_statistics wwguy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).