Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122485
b: refs/heads/master
c: 826d268
h: refs/heads/master
i:
  122483: cc5e1a7
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Dec 5, 2008
1 parent 6ef8525 commit e0b234b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16d68abee5d700bfe09ae8324dbb76028995c589
refs/heads/master: 826d268091f0e0ecc50103f648b6183eb3efe04d
20 changes: 16 additions & 4 deletions trunk/drivers/net/wireless/ath9k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ enum ATH_DEBUG {

#ifdef CONFIG_ATH9K_DEBUG

struct ath9k_debug {
int debug_mask;
struct dentry *debugfs_root;
struct dentry *debugfs_phy;
};

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);
void ath9k_exit_debug(struct ath_softc *sc);

#else

Expand All @@ -98,11 +105,16 @@ static inline void DPRINTF(struct ath_softc *sc, int dbg_mask,
{
}

static inline ath9k_init_debug(struct ath_softc *sc)
static inline int ath9k_init_debug(struct ath_softc *sc)
{
return 0;
}

#endif
static inline void ath9k_exit_debug(struct ath_softc *sc)
{
}

#endif /* CONFIG_ATH9K_DEBUG */

struct ath_config {
u32 ath_aggr_prot;
Expand Down Expand Up @@ -619,7 +631,7 @@ struct ath_softc {
u8 sc_bssidmask[ETH_ALEN];

#ifdef CONFIG_ATH9K_DEBUG
int sc_debug;
struct ath9k_debug sc_debug;
#endif
u32 sc_intrstatus;
u32 sc_flags; /* SC_OP_* */
Expand Down
26 changes: 23 additions & 3 deletions trunk/drivers/net/wireless/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,7 @@ static void ath_detach(struct ath_softc *sc)
ath_tx_cleanupq(sc, &sc->sc_txq[i]);

ath9k_hw_detach(sc->sc_ah);
ath9k_exit_debug(sc);
}

static int ath_init(u16 devid, struct ath_softc *sc)
Expand All @@ -1311,7 +1312,8 @@ static int ath_init(u16 devid, struct ath_softc *sc)
/* XXX: hardware will not be ready until ath_open() being called */
sc->sc_flags |= SC_OP_INVALID;

ath9k_init_debug(sc);
if (ath9k_init_debug(sc) < 0)
printk(KERN_ERR "Unable to create debugfs files\n");

spin_lock_init(&sc->sc_resetlock);
tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
Expand Down

0 comments on commit e0b234b

Please sign in to comment.