blob: a9600ba8ceaabc1f29cb9be36be579c9ded5dc22 [file] [log] [blame]
Luis R. Rodriguezc46917b2009-09-13 02:42:02 -07001/*
2 * Copyright (c) 2009 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 "ath.h"
18#include "debug.h"
19
20void ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
21{
Joe Perches7e559ec2010-11-09 16:35:17 -080022 struct va_format vaf;
Luis R. Rodriguezc46917b2009-09-13 02:42:02 -070023 va_list args;
24
25 if (likely(!(common->debug_mask & dbg_mask)))
26 return;
27
28 va_start(args, fmt);
Joe Perches7e559ec2010-11-09 16:35:17 -080029
30 vaf.fmt = fmt;
31 vaf.va = &args;
32
33 printk(KERN_DEBUG "ath: %pV", &vaf);
34
Luis R. Rodriguezc46917b2009-09-13 02:42:02 -070035 va_end(args);
36}
37EXPORT_SYMBOL(ath_print);
Ben Greear92c68a62010-10-08 09:43:29 -070038
39const char *ath_opmode_to_string(enum nl80211_iftype opmode)
40{
41 switch (opmode) {
42 case NL80211_IFTYPE_UNSPECIFIED:
43 return "UNSPEC";
44 case NL80211_IFTYPE_ADHOC:
45 return "ADHOC";
46 case NL80211_IFTYPE_STATION:
47 return "STATION";
48 case NL80211_IFTYPE_AP:
49 return "AP";
50 case NL80211_IFTYPE_AP_VLAN:
51 return "AP-VLAN";
52 case NL80211_IFTYPE_WDS:
53 return "WDS";
54 case NL80211_IFTYPE_MONITOR:
55 return "MONITOR";
56 case NL80211_IFTYPE_MESH_POINT:
57 return "MESH";
58 case NL80211_IFTYPE_P2P_CLIENT:
59 return "P2P-CLIENT";
60 case NL80211_IFTYPE_P2P_GO:
61 return "P2P-GO";
62 default:
Joe Perches908ebfb2010-10-12 11:07:44 -070063 return "UNKNOWN";
Ben Greear92c68a62010-10-08 09:43:29 -070064 }
65}
66EXPORT_SYMBOL(ath_opmode_to_string);