aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2009-08-19 06:53:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:36:08 -0400
commit22e66a4c15b063aee5d03991c4b9629a3b0c4556 (patch)
treefd1ceba19ae5189374c951b41b4874d23385627c /drivers/net
parentff36041652fcb9f5c17bdbeb081414f69521f1af (diff)
ath9k: Nuke struct ath9k_node_stats
Other than ns_avgbrssi (Average beacon rssi) no data of ath9k_node_stats is being used anywhere. Nuke this structure and move its only useful member to ar5416Anistate. Also cleanup this redundant data in ath_softc. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.h15
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
5 files changed, 8 insertions, 25 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index f264097a2f4e..a7cbb07988cf 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -538,7 +538,6 @@ void ath9k_ani_reset(struct ath_hw *ah)
538} 538}
539 539
540void ath9k_hw_ani_monitor(struct ath_hw *ah, 540void ath9k_hw_ani_monitor(struct ath_hw *ah,
541 const struct ath9k_node_stats *stats,
542 struct ath9k_channel *chan) 541 struct ath9k_channel *chan)
543{ 542{
544 struct ar5416AniState *aniState; 543 struct ar5416AniState *aniState;
@@ -550,7 +549,6 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
550 return; 549 return;
551 550
552 aniState = ah->curani; 551 aniState = ah->curani;
553 ah->stats.ast_nodestats = *stats;
554 552
555 listenTime = ath9k_hw_ani_get_listen_time(ah); 553 listenTime = ath9k_hw_ani_get_listen_time(ah);
556 if (listenTime < 0) { 554 if (listenTime < 0) {
@@ -693,8 +691,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
693 * any of the MIB counters overflow/trigger so don't assume we're 691 * any of the MIB counters overflow/trigger so don't assume we're
694 * here because a PHY error counter triggered. 692 * here because a PHY error counter triggered.
695 */ 693 */
696void ath9k_hw_procmibevent(struct ath_hw *ah, 694void ath9k_hw_procmibevent(struct ath_hw *ah)
697 const struct ath9k_node_stats *stats)
698{ 695{
699 u32 phyCnt1, phyCnt2; 696 u32 phyCnt1, phyCnt2;
700 697
@@ -706,7 +703,6 @@ void ath9k_hw_procmibevent(struct ath_hw *ah,
706 703
707 /* Clear the mib counters and save them in the stats */ 704 /* Clear the mib counters and save them in the stats */
708 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); 705 ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
709 ah->stats.ast_nodestats = *stats;
710 706
711 if (!DO_ANI(ah)) 707 if (!DO_ANI(ah))
712 return; 708 return;
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 6273fd056c2e..4e1ab94a5153 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -21,7 +21,7 @@
21 21
22#define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI)) 22#define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI))
23 23
24#define BEACON_RSSI(ahp) (ahp->stats.ast_nodestats.ns_avgbrssi) 24#define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
25 25
26#define ATH9K_ANI_OFDM_TRIG_HIGH 500 26#define ATH9K_ANI_OFDM_TRIG_HIGH 500
27#define ATH9K_ANI_OFDM_TRIG_LOW 200 27#define ATH9K_ANI_OFDM_TRIG_LOW 200
@@ -60,13 +60,6 @@ struct ath9k_mib_stats {
60 u32 beacons; 60 u32 beacons;
61}; 61};
62 62
63struct ath9k_node_stats {
64 u32 ns_avgbrssi;
65 u32 ns_avgrssi;
66 u32 ns_avgtxrssi;
67 u32 ns_avgtxrate;
68};
69
70struct ar5416AniState { 63struct ar5416AniState {
71 struct ath9k_channel *c; 64 struct ath9k_channel *c;
72 u8 noiseImmunityLevel; 65 u8 noiseImmunityLevel;
@@ -110,21 +103,19 @@ struct ar5416Stats {
110 u32 ast_ani_reset; 103 u32 ast_ani_reset;
111 u32 ast_ani_lzero; 104 u32 ast_ani_lzero;
112 u32 ast_ani_lneg; 105 u32 ast_ani_lneg;
106 u32 avgbrssi;
113 struct ath9k_mib_stats ast_mibstats; 107 struct ath9k_mib_stats ast_mibstats;
114 struct ath9k_node_stats ast_nodestats;
115}; 108};
116#define ah_mibStats stats.ast_mibstats 109#define ah_mibStats stats.ast_mibstats
117 110
118void ath9k_ani_reset(struct ath_hw *ah); 111void ath9k_ani_reset(struct ath_hw *ah);
119void ath9k_hw_ani_monitor(struct ath_hw *ah, 112void ath9k_hw_ani_monitor(struct ath_hw *ah,
120 const struct ath9k_node_stats *stats,
121 struct ath9k_channel *chan); 113 struct ath9k_channel *chan);
122void ath9k_enable_mib_counters(struct ath_hw *ah); 114void ath9k_enable_mib_counters(struct ath_hw *ah);
123void ath9k_hw_disable_mib_counters(struct ath_hw *ah); 115void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
124u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt, 116u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
125 u32 *rxf_pcnt, u32 *txf_pcnt); 117 u32 *rxf_pcnt, u32 *txf_pcnt);
126void ath9k_hw_procmibevent(struct ath_hw *ah, 118void ath9k_hw_procmibevent(struct ath_hw *ah);
127 const struct ath9k_node_stats *stats);
128void ath9k_hw_ani_setup(struct ath_hw *ah); 119void ath9k_hw_ani_setup(struct ath_hw *ah);
129void ath9k_hw_ani_init(struct ath_hw *ah); 120void ath9k_hw_ani_init(struct ath_hw *ah);
130void ath9k_hw_ani_disable(struct ath_hw *ah); 121void ath9k_hw_ani_disable(struct ath_hw *ah);
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 0e444a629040..7705da1103f4 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -603,7 +603,6 @@ struct ath_softc {
603 int beacon_interval; 603 int beacon_interval;
604 604
605 struct ath_ani ani; 605 struct ath_ani ani;
606 struct ath9k_node_stats nodestats;
607#ifdef CONFIG_ATH9K_DEBUG 606#ifdef CONFIG_ATH9K_DEBUG
608 struct ath9k_debug debug; 607 struct ath9k_debug debug;
609#endif 608#endif
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index de197117fdcf..9b9b4e8ee1ea 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -384,7 +384,7 @@ static void ath_ani_calibrate(unsigned long data)
384 if (longcal || shortcal || aniflag) { 384 if (longcal || shortcal || aniflag) {
385 /* Call ANI routine if necessary */ 385 /* Call ANI routine if necessary */
386 if (aniflag) 386 if (aniflag)
387 ath9k_hw_ani_monitor(ah, &sc->nodestats, ah->curchan); 387 ath9k_hw_ani_monitor(ah, ah->curchan);
388 388
389 /* Perform calibration if necessary */ 389 /* Perform calibration if necessary */
390 if (longcal || shortcal) { 390 if (longcal || shortcal) {
@@ -589,7 +589,7 @@ irqreturn_t ath_isr(int irq, void *dev)
589 * it will clear whatever condition caused 589 * it will clear whatever condition caused
590 * the interrupt. 590 * the interrupt.
591 */ 591 */
592 ath9k_hw_procmibevent(ah, &sc->nodestats); 592 ath9k_hw_procmibevent(ah);
593 ath9k_hw_set_interrupts(ah, sc->imask); 593 ath9k_hw_set_interrupts(ah, sc->imask);
594 } 594 }
595 595
@@ -940,10 +940,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
940 ath_beacon_config(sc, vif); 940 ath_beacon_config(sc, vif);
941 941
942 /* Reset rssi stats */ 942 /* Reset rssi stats */
943 sc->nodestats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; 943 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
944 sc->nodestats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER;
945 sc->nodestats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER;
946 sc->nodestats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER;
947 944
948 ath_start_ani(sc); 945 ath_start_ani(sc);
949 } else { 946 } else {
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 61dbdd227444..7b62c220d5fd 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -222,7 +222,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
222 222
223 /* Update Beacon RSSI, this is used by ANI. */ 223 /* Update Beacon RSSI, this is used by ANI. */
224 if (ieee80211_is_beacon(fc)) 224 if (ieee80211_is_beacon(fc))
225 sc->nodestats.ns_avgbrssi = ds->ds_rxstat.rs_rssi; 225 sc->sc_ah->stats.avgbrssi = ds->ds_rxstat.rs_rssi;
226 226
227 rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp); 227 rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp);
228 rx_status->band = hw->conf.channel->band; 228 rx_status->band = hw->conf.channel->band;