blob: 31af7cc0fa344e9543cca3c75bbf179f9b27f86b [file] [log] [blame]
Sujith88b126a2008-11-28 22:19:02 +05301/*
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
19static unsigned int ath9k_debug = DBG_DEFAULT;
20module_param_named(debug, ath9k_debug, uint, 0);
21
22void 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
37void ath9k_init_debug(struct ath_softc *sc)
38{
39 sc->sc_debug = ath9k_debug;
40}