linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, bob@bobcopeland.com,
	ath5k-devel@lists.ath5k.org, lrodriguez@atheros.com,
	mickflemm@gmail.com
Subject: [PATCH 09/10] ath5k: add capability flag for phyerror counters
Date: Thu, 25 Mar 2010 14:49:47 +0900	[thread overview]
Message-ID: <20100325054947.10697.26504.stgit@tt-desk> (raw)
In-Reply-To: <20100325054603.10697.48915.stgit@tt-desk>

Chipsets since revision AR5213A (0x59) have hardware counters for PHY errors
which we can read directly from the registers. Older hardware has to use the RX
descriptor status to get a count of PHY errors. This will be used in several
places in the ANI implementation, so a flag is useful.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 drivers/net/wireless/ath/ath5k/ath5k.h |    2 ++
 drivers/net/wireless/ath/ath5k/caps.c  |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index ec62690..f578c1e 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -982,6 +982,8 @@ struct ath5k_capabilities {
 	struct {
 		u8	q_tx_num;
 	} cap_queues;
+
+	bool cap_has_phyerr_counters;
 };
 
 /* size of noise floor history (keep it a power of two) */
diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c
index e618e71..74f0071 100644
--- a/drivers/net/wireless/ath/ath5k/caps.c
+++ b/drivers/net/wireless/ath/ath5k/caps.c
@@ -109,6 +109,12 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
 	else
 		ah->ah_capabilities.cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES;
 
+	/* newer hardware has PHY error counters */
+	if (ah->ah_mac_srev >= AR5K_SREV_AR5213A)
+		ah->ah_capabilities.cap_has_phyerr_counters = true;
+	else
+		ah->ah_capabilities.cap_has_phyerr_counters = false;
+
 	return 0;
 }
 


  parent reply	other threads:[~2010-03-25  5:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25  5:48 [PATCH 00/10] ANI for ath5k Bruno Randolf
2010-03-25  5:49 ` [PATCH 01/10] ath5k: remove static calibration interval variable Bruno Randolf
2010-03-25  5:49 ` [PATCH 02/10] ath5k: remove the use of SWI interrupt Bruno Randolf
2010-03-25  5:49 ` [PATCH 03/10] ath5k: optimize ath5k_hw_calibration_poll Bruno Randolf
2010-03-25  5:49 ` [PATCH 04/10] ath5k: move ath5k_hw_calibration_poll to base.c Bruno Randolf
2010-03-25  5:49 ` [PATCH 05/10] ath5k: keep beacon RSSI average Bruno Randolf
2010-03-25  5:49 ` [PATCH 06/10] ath5k: initialize default noise floor Bruno Randolf
2010-03-25  5:49 ` [PATCH 07/10] ath5k: simplify MIB counters Bruno Randolf
2010-03-25  5:49 ` [PATCH 08/10] ath5k: update phy errors codes Bruno Randolf
2010-03-25  5:49 ` Bruno Randolf [this message]
2010-03-25  5:49 ` [PATCH 10/10] ath5k: Adaptive Noise Immunity (ANI) Implementation Bruno Randolf
2010-03-25 10:59   ` Joerg Pommnitz
2010-03-26  0:18     ` Bruno Randolf
2010-03-29  2:02   ` [ath5k-devel] " Bob Copeland
2010-03-29  2:26     ` Bruno Randolf
2010-03-25 21:10 ` [ath5k-devel] [PATCH 00/10] ANI for ath5k Derek Smithies
2010-03-25 21:13   ` Luis R. Rodriguez
2010-03-26  0:27     ` Bruno Randolf
2010-03-26  0:44       ` Luis R. Rodriguez
2010-03-26  0:53         ` Bruno Randolf
2010-03-26  1:06           ` Luis R. Rodriguez
2010-03-26  1:21       ` Derek Smithies
2010-03-26  1:32         ` Luis R. Rodriguez
2010-03-26  1:46         ` Bruno Randolf
2010-03-26 20:34           ` Derek Smithies
2010-03-27  5:18             ` Bruno Randolf

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=20100325054947.10697.26504.stgit@tt-desk \
    --to=br1@einfach.org \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=bob@bobcopeland.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --cc=mickflemm@gmail.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 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).