aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/debug.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-11-28 11:50:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-05 09:35:09 -0500
commit826d268091f0e0ecc50103f648b6183eb3efe04d (patch)
tree16f9f535377f47501fac33e9f72a70ae7b47a0fb /drivers/net/wireless/ath9k/debug.c
parent16d68abee5d700bfe09ae8324dbb76028995c589 (diff)
ath9k: Add initial layout for an ath9k specific debugfs mechanism
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/debug.c')
-rw-r--r--drivers/net/wireless/ath9k/debug.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c
index 31af7cc0fa34..c146e484ef54 100644
--- a/drivers/net/wireless/ath9k/debug.c
+++ b/drivers/net/wireless/ath9k/debug.c
@@ -24,7 +24,7 @@ void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...)
24 if (!sc) 24 if (!sc)
25 return; 25 return;
26 26
27 if (sc->sc_debug & dbg_mask) { 27 if (sc->sc_debug.debug_mask & dbg_mask) {
28 va_list args; 28 va_list args;
29 29
30 va_start(args, fmt); 30 va_start(args, fmt);
@@ -34,7 +34,27 @@ void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...)
34 } 34 }
35} 35}
36 36
37void ath9k_init_debug(struct ath_softc *sc) 37int ath9k_init_debug(struct ath_softc *sc)
38{ 38{
39 sc->sc_debug = ath9k_debug; 39 sc->sc_debug.debug_mask = ath9k_debug;
40
41 sc->sc_debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
42 if (!sc->sc_debug.debugfs_root)
43 goto err;
44
45 sc->sc_debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
46 sc->sc_debug.debugfs_root);
47 if (!sc->sc_debug.debugfs_phy)
48 goto err;
49
50 return 0;
51err:
52 ath9k_exit_debug(sc);
53 return -ENOMEM;
54}
55
56void ath9k_exit_debug(struct ath_softc *sc)
57{
58 debugfs_remove(sc->sc_debug.debugfs_phy);
59 debugfs_remove(sc->sc_debug.debugfs_root);
40} 60}