diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-11-28 22:20:23 +0530 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:35:09 -0500 |
commit | 826d268091f0e0ecc50103f648b6183eb3efe04d (patch) | |
tree | 16f9f535377f47501fac33e9f72a70ae7b47a0fb /drivers/net/wireless/ath9k/debug.c | |
parent | 16d68abee5d700bfe09ae8324dbb76028995c589 (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.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c index 31af7cc0fa3..c146e484ef5 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, ...) if (!sc) return; - if (sc->sc_debug & dbg_mask) { + if (sc->sc_debug.debug_mask & dbg_mask) { va_list args; va_start(args, fmt); @@ -34,7 +34,27 @@ void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) } } -void ath9k_init_debug(struct ath_softc *sc) +int ath9k_init_debug(struct ath_softc *sc) { - sc->sc_debug = ath9k_debug; + sc->sc_debug.debug_mask = ath9k_debug; + + sc->sc_debug.debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); + if (!sc->sc_debug.debugfs_root) + goto err; + + sc->sc_debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy), + sc->sc_debug.debugfs_root); + if (!sc->sc_debug.debugfs_phy) + goto err; + + return 0; +err: + ath9k_exit_debug(sc); + return -ENOMEM; +} + +void ath9k_exit_debug(struct ath_softc *sc) +{ + debugfs_remove(sc->sc_debug.debugfs_phy); + debugfs_remove(sc->sc_debug.debugfs_root); } |