aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-25 01:49:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:10 -0400
commita8c944f8a00dcc4ac6900efcddab1a0cf300c791 (patch)
tree94dd655f078c6f4dc1ec924e110ad33813268dbe
parentda35111ad970081bdf6e848d1861c7d16e71079b (diff)
ath5k: add capability flag for phyerror counters
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/caps.c6
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 ec626905655b..f578c1ed7f88 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -982,6 +982,8 @@ struct ath5k_capabilities {
982 struct { 982 struct {
983 u8 q_tx_num; 983 u8 q_tx_num;
984 } cap_queues; 984 } cap_queues;
985
986 bool cap_has_phyerr_counters;
985}; 987};
986 988
987/* size of noise floor history (keep it a power of two) */ 989/* 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 e618e71b1ce6..74f007126f41 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)
109 else 109 else
110 ah->ah_capabilities.cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES; 110 ah->ah_capabilities.cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES;
111 111
112 /* newer hardware has PHY error counters */
113 if (ah->ah_mac_srev >= AR5K_SREV_AR5213A)
114 ah->ah_capabilities.cap_has_phyerr_counters = true;
115 else
116 ah->ah_capabilities.cap_has_phyerr_counters = false;
117
112 return 0; 118 return 0;
113} 119}
114 120