Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-drm-fsl-dcu.git] / drivers / net / wireless / ath / ath9k / debug.c
index e7b709f03b29ef4149f358b358627e2ba831410d..871e969409bfd16e0b6c0fe43d9407fc7dde1d51 100644 (file)
@@ -754,13 +754,14 @@ static int read_file_misc(struct seq_file *file, void *data)
 
        i = 0;
        ath_for_each_chanctx(sc, ctx) {
-               if (!ctx->assigned || list_empty(&ctx->vifs))
+               if (list_empty(&ctx->vifs))
                        continue;
                ath9k_calculate_iter_data(sc, ctx, &iter_data);
 
                seq_printf(file,
-                          "VIF-COUNTS: CTX %i AP: %i STA: %i MESH: %i WDS: %i",
-                          i++, iter_data.naps, iter_data.nstations,
+                          "VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i WDS: %i",
+                          i++, (int)(ctx->assigned), iter_data.naps,
+                          iter_data.nstations,
                           iter_data.nmeshes, iter_data.nwds);
                seq_printf(file, " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
                           iter_data.nadhocs, sc->cur_chan->nvifs,
@@ -773,25 +774,28 @@ static int read_file_misc(struct seq_file *file, void *data)
 static int read_file_reset(struct seq_file *file, void *data)
 {
        struct ath_softc *sc = file->private;
+       static const char * const reset_cause[__RESET_TYPE_MAX] = {
+               [RESET_TYPE_BB_HANG] = "Baseband Hang",
+               [RESET_TYPE_BB_WATCHDOG] = "Baseband Watchdog",
+               [RESET_TYPE_FATAL_INT] = "Fatal HW Error",
+               [RESET_TYPE_TX_ERROR] = "TX HW error",
+               [RESET_TYPE_TX_GTT] = "Transmit timeout",
+               [RESET_TYPE_TX_HANG] = "TX Path Hang",
+               [RESET_TYPE_PLL_HANG] = "PLL RX Hang",
+               [RESET_TYPE_MAC_HANG] = "MAC Hang",
+               [RESET_TYPE_BEACON_STUCK] = "Stuck Beacon",
+               [RESET_TYPE_MCI] = "MCI Reset",
+               [RESET_TYPE_CALIBRATION] = "Calibration error",
+       };
+       int i;
 
-       seq_printf(file, "%17s: %2d\n", "Baseband Hang",
-                  sc->debug.stats.reset[RESET_TYPE_BB_HANG]);
-       seq_printf(file, "%17s: %2d\n", "Baseband Watchdog",
-                  sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG]);
-       seq_printf(file, "%17s: %2d\n", "Fatal HW Error",
-                  sc->debug.stats.reset[RESET_TYPE_FATAL_INT]);
-       seq_printf(file, "%17s: %2d\n", "TX HW error",
-                  sc->debug.stats.reset[RESET_TYPE_TX_ERROR]);
-       seq_printf(file, "%17s: %2d\n", "TX Path Hang",
-                  sc->debug.stats.reset[RESET_TYPE_TX_HANG]);
-       seq_printf(file, "%17s: %2d\n", "PLL RX Hang",
-                  sc->debug.stats.reset[RESET_TYPE_PLL_HANG]);
-       seq_printf(file, "%17s: %2d\n", "MAC Hang",
-                  sc->debug.stats.reset[RESET_TYPE_MAC_HANG]);
-       seq_printf(file, "%17s: %2d\n", "Stuck Beacon",
-                  sc->debug.stats.reset[RESET_TYPE_BEACON_STUCK]);
-       seq_printf(file, "%17s: %2d\n", "MCI Reset",
-                  sc->debug.stats.reset[RESET_TYPE_MCI]);
+       for (i = 0; i < ARRAY_SIZE(reset_cause); i++) {
+               if (!reset_cause[i])
+                   continue;
+
+               seq_printf(file, "%17s: %2d\n", reset_cause[i],
+                          sc->debug.stats.reset[i]);
+       }
 
        return 0;
 }
@@ -1234,7 +1238,7 @@ void ath9k_get_et_stats(struct ieee80211_hw *hw,
 
 void ath9k_deinit_debug(struct ath_softc *sc)
 {
-       ath9k_spectral_deinit_debug(sc);
+       ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
 }
 
 int ath9k_init_debug(struct ath_hw *ah)
@@ -1254,7 +1258,7 @@ int ath9k_init_debug(struct ath_hw *ah)
 
        ath9k_dfs_init_debug(sc);
        ath9k_tx99_init_debug(sc);
-       ath9k_spectral_init_debug(sc);
+       ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy);
 
        debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
                            &fops_dma);