aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-09 02:55:17 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-03-10 17:44:30 -0500
commit604eeadd1880bddfb155369491cc13fb8d3f9df6 (patch)
treec9a7357fa34d9751c0dc2b36fb1004281a083cfb /drivers/net/wireless/ath/ath5k/base.c
parent5a7d05830de1ecfdaf0a9fb43e4aa08abbdbfe9f (diff)
ath5k: add antenna statistics and debugfs file for antenna settings
keep statistics about which antenna was used for TX and RX. this is used only for debugging right now, but might have other applications later. add a new file 'antenna' in debugfs (/sys/kernel/debug/ath5k/phy0/antenna) to show antenna use statistics and antenna diversity related register values. it can also be used to set the antenna mode until we have proper support for that in iw: - echo diversity > antenna: use default antenna mode (RX and TX diversity) - echo fixed-a > antenna: use fixed antenna A for RX and TX - echo fixed-b > antenna: use fixed antenna B for RX and TX - echo clear > antenna: reset antenna statistics Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7c08434ebd1a..e7a989c707ac 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1997,6 +1997,12 @@ accept:
1997 rxs->signal = rxs->noise + rs.rs_rssi; 1997 rxs->signal = rxs->noise + rs.rs_rssi;
1998 1998
1999 rxs->antenna = rs.rs_antenna; 1999 rxs->antenna = rs.rs_antenna;
2000
2001 if (rs.rs_antenna > 0 && rs.rs_antenna < 5)
2002 sc->stats.antenna_rx[rs.rs_antenna]++;
2003 else
2004 sc->stats.antenna_rx[0]++; /* invalid */
2005
2000 rxs->rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate); 2006 rxs->rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
2001 rxs->flag |= ath5k_rx_decrypted(sc, ds, skb, &rs); 2007 rxs->flag |= ath5k_rx_decrypted(sc, ds, skb, &rs);
2002 2008
@@ -2090,6 +2096,11 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq)
2090 */ 2096 */
2091 ath5k_remove_padding(skb); 2097 ath5k_remove_padding(skb);
2092 2098
2099 if (ts.ts_antenna > 0 && ts.ts_antenna < 5)
2100 sc->stats.antenna_tx[ts.ts_antenna]++;
2101 else
2102 sc->stats.antenna_tx[0]++; /* invalid */
2103
2093 ieee80211_tx_status(sc->hw, skb); 2104 ieee80211_tx_status(sc->hw, skb);
2094 2105
2095 spin_lock(&sc->txbuflock); 2106 spin_lock(&sc->txbuflock);