All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
	"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: [PATCH v2 13/20] ath9k_hw: remove unused and buggy ath9k_hw_GetMibCycleCountsPct()
Date: Wed, 17 Mar 2010 18:28:06 -0400	[thread overview]
Message-ID: <1268864893-11428-14-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1268864893-11428-1-git-send-email-lrodriguez@atheros.com>

ath9k_hw_GetMibCycleCountsPct() is unused and in fact it would be buggy
if used anyway. The right implementation is done throguh
ath9k_hw_ani_get_listen_time() which is already present as well.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ani.c |   41 ----------------------------------
 drivers/net/wireless/ath/ath9k/ani.h |    2 -
 2 files changed, 0 insertions(+), 43 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 7e87cf4..71bf201 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -750,47 +750,6 @@ void ath9k_hw_disable_mib_counters(struct ath_hw *ah)
 	REG_WRITE(ah, AR_FILT_CCK, 0);
 }
 
-u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
-				  u32 *rxc_pcnt,
-				  u32 *rxf_pcnt,
-				  u32 *txf_pcnt)
-{
-	struct ath_common *common = ath9k_hw_common(ah);
-	static u32 cycles, rx_clear, rx_frame, tx_frame;
-	u32 good = 1;
-
-	u32 rc = REG_READ(ah, AR_RCCNT);
-	u32 rf = REG_READ(ah, AR_RFCNT);
-	u32 tf = REG_READ(ah, AR_TFCNT);
-	u32 cc = REG_READ(ah, AR_CCCNT);
-
-	if (cycles == 0 || cycles > cc) {
-		ath_print(common, ATH_DBG_ANI,
-			  "cycle counter wrap. ExtBusy = 0\n");
-		good = 0;
-	} else {
-		u32 cc_d = cc - cycles;
-		u32 rc_d = rc - rx_clear;
-		u32 rf_d = rf - rx_frame;
-		u32 tf_d = tf - tx_frame;
-
-		if (cc_d != 0) {
-			*rxc_pcnt = rc_d * 100 / cc_d;
-			*rxf_pcnt = rf_d * 100 / cc_d;
-			*txf_pcnt = tf_d * 100 / cc_d;
-		} else {
-			good = 0;
-		}
-	}
-
-	cycles = cc;
-	rx_frame = rf;
-	rx_clear = rc;
-	tx_frame = tf;
-
-	return good;
-}
-
 /*
  * Process a MIB interrupt.  We may potentially be invoked because
  * any of the MIB counters overflow/trigger so don't assume we're
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 4e1ab94..01c07e2 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -113,8 +113,6 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
 			  struct ath9k_channel *chan);
 void ath9k_enable_mib_counters(struct ath_hw *ah);
 void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
-u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
-				  u32 *rxf_pcnt, u32 *txf_pcnt);
 void ath9k_hw_procmibevent(struct ath_hw *ah);
 void ath9k_hw_ani_setup(struct ath_hw *ah);
 void ath9k_hw_ani_init(struct ath_hw *ah);
-- 
1.6.3.3


WARNING: multiple messages have this Message-ID (diff)
From: Luis R. Rodriguez <lrodriguez@atheros.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH v2 13/20] ath9k_hw: remove unused and buggy ath9k_hw_GetMibCycleCountsPct()
Date: Wed, 17 Mar 2010 18:28:06 -0400	[thread overview]
Message-ID: <1268864893-11428-14-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1268864893-11428-1-git-send-email-lrodriguez@atheros.com>

ath9k_hw_GetMibCycleCountsPct() is unused and in fact it would be buggy
if used anyway. The right implementation is done throguh
ath9k_hw_ani_get_listen_time() which is already present as well.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ani.c |   41 ----------------------------------
 drivers/net/wireless/ath/ath9k/ani.h |    2 -
 2 files changed, 0 insertions(+), 43 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 7e87cf4..71bf201 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -750,47 +750,6 @@ void ath9k_hw_disable_mib_counters(struct ath_hw *ah)
 	REG_WRITE(ah, AR_FILT_CCK, 0);
 }
 
-u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
-				  u32 *rxc_pcnt,
-				  u32 *rxf_pcnt,
-				  u32 *txf_pcnt)
-{
-	struct ath_common *common = ath9k_hw_common(ah);
-	static u32 cycles, rx_clear, rx_frame, tx_frame;
-	u32 good = 1;
-
-	u32 rc = REG_READ(ah, AR_RCCNT);
-	u32 rf = REG_READ(ah, AR_RFCNT);
-	u32 tf = REG_READ(ah, AR_TFCNT);
-	u32 cc = REG_READ(ah, AR_CCCNT);
-
-	if (cycles == 0 || cycles > cc) {
-		ath_print(common, ATH_DBG_ANI,
-			  "cycle counter wrap. ExtBusy = 0\n");
-		good = 0;
-	} else {
-		u32 cc_d = cc - cycles;
-		u32 rc_d = rc - rx_clear;
-		u32 rf_d = rf - rx_frame;
-		u32 tf_d = tf - tx_frame;
-
-		if (cc_d != 0) {
-			*rxc_pcnt = rc_d * 100 / cc_d;
-			*rxf_pcnt = rf_d * 100 / cc_d;
-			*txf_pcnt = tf_d * 100 / cc_d;
-		} else {
-			good = 0;
-		}
-	}
-
-	cycles = cc;
-	rx_frame = rf;
-	rx_clear = rc;
-	tx_frame = tf;
-
-	return good;
-}
-
 /*
  * Process a MIB interrupt.  We may potentially be invoked because
  * any of the MIB counters overflow/trigger so don't assume we're
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 4e1ab94..01c07e2 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -113,8 +113,6 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
 			  struct ath9k_channel *chan);
 void ath9k_enable_mib_counters(struct ath_hw *ah);
 void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
-u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
-				  u32 *rxf_pcnt, u32 *txf_pcnt);
 void ath9k_hw_procmibevent(struct ath_hw *ah);
 void ath9k_hw_ani_setup(struct ath_hw *ah);
 void ath9k_hw_ani_init(struct ath_hw *ah);
-- 
1.6.3.3

  parent reply	other threads:[~2010-03-17 22:28 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 22:27 [PATCH v2 00/20] ath9k_hw: ar93xx initial abstraction work Luis R. Rodriguez
2010-03-17 22:27 ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:27 ` [PATCH v2 01/20] ath9k: start building an abstraction layer for hardware routines Luis R. Rodriguez
2010-03-17 22:27   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:27 ` [PATCH v2 02/20] ath9k: initial move of ar9002 specific code to its own file Luis R. Rodriguez
2010-03-17 22:27   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:27 ` [PATCH v2 03/20] ath9k: rename initvals.h to ar9002_initvals.h Luis R. Rodriguez
2010-03-17 22:27   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:27 ` [PATCH v2 04/20] ath9k_hw: rename getNoiseFloorThresh() to ath9k_hw_getnf_thres() Luis R. Rodriguez
2010-03-17 22:27   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:27 ` [PATCH v2 05/20] ath9k_hw: move < AR9002 specific calibration stuff to its own file Luis R. Rodriguez
2010-03-17 22:27   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:27 ` [PATCH v2 06/20] ath9k_hw: move calibration settings to ar9002_calib_settings.c Luis R. Rodriguez
2010-03-17 22:27   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 07/20] ath9k_hw: consolidate the pci express checks on __ath9k_hw_init() Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 08/20] ath9k_hw: move ar9002 bluetooth coexistence code to its own file Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 09/20] ath9k_hw: Use a helper for setting phy error masks Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 10/20] ath9k_hw: add helpers for writing phy errors counts Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 11/20] ath9k_hw: add a helper for phy error counter reads Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 12/20] ath9k_hw: add documentation for the TPC register Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` Luis R. Rodriguez [this message]
2010-03-17 22:28   ` [ath9k-devel] [PATCH v2 13/20] ath9k_hw: remove unused and buggy ath9k_hw_GetMibCycleCountsPct() Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 14/20] ath9k_hw: add a helper for retrieving the MIB cycle counters Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 15/20] ath9k_hw: provide a helper for clearing the MIB counters Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 16/20] ath9k_hw: simplify reseting of the MIB control register Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 17/20] ath9k_hw: provide a helper for managing " Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 18/20] ath9k_hw: move common defines for ANI into ath/reg.h Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 19/20] ath9k_hw: move ar9002 ANI code to its own file Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:28 ` [PATCH v2 20/20] ath9k_hw: remove wrapper ath9k_hw_write_regs() Luis R. Rodriguez
2010-03-17 22:28   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:32 ` [PATCH v2 00/20] ath9k_hw: ar93xx initial abstraction work Luis R. Rodriguez
2010-03-17 22:32   ` [ath9k-devel] " Luis R. Rodriguez
2010-03-17 22:50   ` Luis R. Rodriguez
2010-03-17 22:50     ` [ath9k-devel] " Luis R. Rodriguez
2010-03-18  1:53     ` Luis R. Rodriguez
2010-03-18  1:53       ` [ath9k-devel] " Luis R. Rodriguez
2010-03-23 20:44       ` John W. Linville
2010-03-23 20:44         ` [ath9k-devel] " John W. Linville
2010-03-23 20:53         ` Luis R. Rodriguez
2010-03-23 20:53           ` [ath9k-devel] " Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268864893-11428-14-git-send-email-lrodriguez@atheros.com \
    --to=lrodriguez@atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.