diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-11-28 11:49:02 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:35:08 -0500 |
commit | 88b126af946e7ea789f2a52d9d25aca681f93067 (patch) | |
tree | 0991493a6fc53675ca73d971bb92ae77fb628a48 /drivers/net/wireless/ath9k/debug.c | |
parent | 04bd4638097c767278fdf12d50fecc8b60194d39 (diff) |
ath9k: Add ATH9K_DEBUG configuration option
Make debugging configurable, and add a module parameter
to give the debug mask.
Add debug.c to hold all debug specific code.
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 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c new file mode 100644 index 000000000000..31af7cc0fa34 --- /dev/null +++ b/drivers/net/wireless/ath9k/debug.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008 Atheros Communications Inc. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #include "core.h" | ||
18 | |||
19 | static unsigned int ath9k_debug = DBG_DEFAULT; | ||
20 | module_param_named(debug, ath9k_debug, uint, 0); | ||
21 | |||
22 | void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...) | ||
23 | { | ||
24 | if (!sc) | ||
25 | return; | ||
26 | |||
27 | if (sc->sc_debug & dbg_mask) { | ||
28 | va_list args; | ||
29 | |||
30 | va_start(args, fmt); | ||
31 | printk(KERN_DEBUG "ath9k: "); | ||
32 | vprintk(fmt, args); | ||
33 | va_end(args); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | void ath9k_init_debug(struct ath_softc *sc) | ||
38 | { | ||
39 | sc->sc_debug = ath9k_debug; | ||
40 | } | ||