ath9k: simplify DFS pulse interval debug printing
authorZefir Kurtisi <zefir.kurtisi@neratec.com>
Fri, 23 May 2014 15:22:37 +0000 (17:22 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 May 2014 17:08:10 +0000 (13:08 -0400)
Make DFS pulse interval calculation independent
from CONFIG_ATH9K_DEBUGFS.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/dfs.c
drivers/net/wireless/ath/ath9k/dfs_debug.h

index b20469425865d21299b4d34b1572c866de878bf2..2ca8f7e061742420fe00a9bddf61fb366feb93dc 100644 (file)
@@ -770,6 +770,7 @@ struct ath_softc {
        struct ath_ant_comb ant_comb;
        u8 ant_tx, ant_rx;
        struct dfs_pattern_detector *dfs_detector;
+       u64 dfs_prev_pulse_ts;
        u32 wow_enabled;
        /* relay(fs) channel for spectral scan */
        struct rchan *rfs_chan_spec_scan;
index e0c740dcfea8e27438eb95f5fd6d2a48e1423131..726271c7c3306e8a9255fd645bcbe0d3c6d8fb3e 100644 (file)
@@ -178,14 +178,12 @@ void ath9k_dfs_process_phyerr(struct ath_softc *sc, void *data,
        pe.ts = mactime;
        if (ath9k_postprocess_radar_event(sc, &ard, &pe)) {
                struct dfs_pattern_detector *pd = sc->dfs_detector;
-#ifdef CONFIG_ATH9K_DEBUGFS
                ath_dbg(common, DFS,
                        "ath9k_dfs_process_phyerr: channel=%d, ts=%llu, "
                        "width=%d, rssi=%d, delta_ts=%llu\n",
                        pe.freq, pe.ts, pe.width, pe.rssi,
-                       pe.ts - sc->debug.stats.dfs_stats.last_ts);
-               sc->debug.stats.dfs_stats.last_ts = pe.ts;
-#endif
+                       pe.ts - sc->dfs_prev_pulse_ts);
+               sc->dfs_prev_pulse_ts = pe.ts;
                DFS_STAT_INC(sc, pulses_processed);
                if (pd != NULL && pd->add_pulse(pd, &pe)) {
                        DFS_STAT_INC(sc, radar_detected);
index d9486867a5e00f089de4adb08989a59470ad26d7..7936c9126a20d5dee79cae53bb2a06cdb78ed881 100644 (file)
@@ -51,7 +51,6 @@ struct ath_dfs_stats {
        /* pattern detection stats */
        u32 pulses_processed;
        u32 radar_detected;
-       u64 last_ts;
 };
 
 #if defined(CONFIG_ATH9K_DFS_DEBUGFS)