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>
This commit is contained in:
Vasanthakumar Thiagarajan 2009-08-19 16:23:40 +05:30 committed by John W. Linville
parent ff36041652
commit 22e66a4c15
5 changed files with 8 additions and 25 deletions

View File

@ -538,7 +538,6 @@ void ath9k_ani_reset(struct ath_hw *ah)
} }
void ath9k_hw_ani_monitor(struct ath_hw *ah, void ath9k_hw_ani_monitor(struct ath_hw *ah,
const struct ath9k_node_stats *stats,
struct ath9k_channel *chan) struct ath9k_channel *chan)
{ {
struct ar5416AniState *aniState; struct ar5416AniState *aniState;
@ -550,7 +549,6 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
return; return;
aniState = ah->curani; aniState = ah->curani;
ah->stats.ast_nodestats = *stats;
listenTime = ath9k_hw_ani_get_listen_time(ah); listenTime = ath9k_hw_ani_get_listen_time(ah);
if (listenTime < 0) { if (listenTime < 0) {
@ -693,8 +691,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
* any of the MIB counters overflow/trigger so don't assume we're * any of the MIB counters overflow/trigger so don't assume we're
* here because a PHY error counter triggered. * here because a PHY error counter triggered.
*/ */
void ath9k_hw_procmibevent(struct ath_hw *ah, void ath9k_hw_procmibevent(struct ath_hw *ah)
const struct ath9k_node_stats *stats)
{ {
u32 phyCnt1, phyCnt2; u32 phyCnt1, phyCnt2;
@ -706,7 +703,6 @@ void ath9k_hw_procmibevent(struct ath_hw *ah,
/* Clear the mib counters and save them in the stats */ /* Clear the mib counters and save them in the stats */
ath9k_hw_update_mibstats(ah, &ah->ah_mibStats); ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
ah->stats.ast_nodestats = *stats;
if (!DO_ANI(ah)) if (!DO_ANI(ah))
return; return;

View File

@ -21,7 +21,7 @@
#define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI)) #define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI))
#define BEACON_RSSI(ahp) (ahp->stats.ast_nodestats.ns_avgbrssi) #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
#define ATH9K_ANI_OFDM_TRIG_HIGH 500 #define ATH9K_ANI_OFDM_TRIG_HIGH 500
#define ATH9K_ANI_OFDM_TRIG_LOW 200 #define ATH9K_ANI_OFDM_TRIG_LOW 200
@ -60,13 +60,6 @@ struct ath9k_mib_stats {
u32 beacons; u32 beacons;
}; };
struct ath9k_node_stats {
u32 ns_avgbrssi;
u32 ns_avgrssi;
u32 ns_avgtxrssi;
u32 ns_avgtxrate;
};
struct ar5416AniState { struct ar5416AniState {
struct ath9k_channel *c; struct ath9k_channel *c;
u8 noiseImmunityLevel; u8 noiseImmunityLevel;
@ -110,21 +103,19 @@ struct ar5416Stats {
u32 ast_ani_reset; u32 ast_ani_reset;
u32 ast_ani_lzero; u32 ast_ani_lzero;
u32 ast_ani_lneg; u32 ast_ani_lneg;
u32 avgbrssi;
struct ath9k_mib_stats ast_mibstats; struct ath9k_mib_stats ast_mibstats;
struct ath9k_node_stats ast_nodestats;
}; };
#define ah_mibStats stats.ast_mibstats #define ah_mibStats stats.ast_mibstats
void ath9k_ani_reset(struct ath_hw *ah); void ath9k_ani_reset(struct ath_hw *ah);
void ath9k_hw_ani_monitor(struct ath_hw *ah, void ath9k_hw_ani_monitor(struct ath_hw *ah,
const struct ath9k_node_stats *stats,
struct ath9k_channel *chan); struct ath9k_channel *chan);
void ath9k_enable_mib_counters(struct ath_hw *ah); void ath9k_enable_mib_counters(struct ath_hw *ah);
void ath9k_hw_disable_mib_counters(struct ath_hw *ah); void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt, u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
u32 *rxf_pcnt, u32 *txf_pcnt); u32 *rxf_pcnt, u32 *txf_pcnt);
void ath9k_hw_procmibevent(struct ath_hw *ah, void ath9k_hw_procmibevent(struct ath_hw *ah);
const struct ath9k_node_stats *stats);
void ath9k_hw_ani_setup(struct ath_hw *ah); void ath9k_hw_ani_setup(struct ath_hw *ah);
void ath9k_hw_ani_init(struct ath_hw *ah); void ath9k_hw_ani_init(struct ath_hw *ah);
void ath9k_hw_ani_disable(struct ath_hw *ah); void ath9k_hw_ani_disable(struct ath_hw *ah);

View File

@ -603,7 +603,6 @@ struct ath_softc {
int beacon_interval; int beacon_interval;
struct ath_ani ani; struct ath_ani ani;
struct ath9k_node_stats nodestats;
#ifdef CONFIG_ATH9K_DEBUG #ifdef CONFIG_ATH9K_DEBUG
struct ath9k_debug debug; struct ath9k_debug debug;
#endif #endif

View File

@ -384,7 +384,7 @@ static void ath_ani_calibrate(unsigned long data)
if (longcal || shortcal || aniflag) { if (longcal || shortcal || aniflag) {
/* Call ANI routine if necessary */ /* Call ANI routine if necessary */
if (aniflag) if (aniflag)
ath9k_hw_ani_monitor(ah, &sc->nodestats, ah->curchan); ath9k_hw_ani_monitor(ah, ah->curchan);
/* Perform calibration if necessary */ /* Perform calibration if necessary */
if (longcal || shortcal) { if (longcal || shortcal) {
@ -589,7 +589,7 @@ irqreturn_t ath_isr(int irq, void *dev)
* it will clear whatever condition caused * it will clear whatever condition caused
* the interrupt. * the interrupt.
*/ */
ath9k_hw_procmibevent(ah, &sc->nodestats); ath9k_hw_procmibevent(ah);
ath9k_hw_set_interrupts(ah, sc->imask); ath9k_hw_set_interrupts(ah, sc->imask);
} }
@ -940,10 +940,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
ath_beacon_config(sc, vif); ath_beacon_config(sc, vif);
/* Reset rssi stats */ /* Reset rssi stats */
sc->nodestats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
sc->nodestats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER;
sc->nodestats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER;
sc->nodestats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER;
ath_start_ani(sc); ath_start_ani(sc);
} else { } else {

View File

@ -222,7 +222,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
/* Update Beacon RSSI, this is used by ANI. */ /* Update Beacon RSSI, this is used by ANI. */
if (ieee80211_is_beacon(fc)) if (ieee80211_is_beacon(fc))
sc->nodestats.ns_avgbrssi = ds->ds_rxstat.rs_rssi; sc->sc_ah->stats.avgbrssi = ds->ds_rxstat.rs_rssi;
rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp); rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp);
rx_status->band = hw->conf.channel->band; rx_status->band = hw->conf.channel->band;