瀏覽代碼

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>
Bruno Randolf 15 年之前
父節點
當前提交
a8c944f8a0
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 2 0
      drivers/net/wireless/ath/ath5k/ath5k.h
  2. 6 0
      drivers/net/wireless/ath/ath5k/caps.c

+ 2 - 0
drivers/net/wireless/ath/ath5k/ath5k.h

@@ -982,6 +982,8 @@ struct ath5k_capabilities {
 	struct {
 	struct {
 		u8	q_tx_num;
 		u8	q_tx_num;
 	} cap_queues;
 	} cap_queues;
+
+	bool cap_has_phyerr_counters;
 };
 };
 
 
 /* size of noise floor history (keep it a power of two) */
 /* size of noise floor history (keep it a power of two) */

+ 6 - 0
drivers/net/wireless/ath/ath5k/caps.c

@@ -109,6 +109,12 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
 	else
 	else
 		ah->ah_capabilities.cap_queues.q_tx_num = AR5K_NUM_TX_QUEUES;
 		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;
 	return 0;
 }
 }