drivers/net/wireless/ath/debug.c: Use printf extension %pV
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / net / wireless / ath / debug.c
bloba9600ba8ceaabc1f29cb9be36be579c9ded5dc22
1 /*
2 * Copyright (c) 2009 Atheros Communications Inc.
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.
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.
17 #include "ath.h"
18 #include "debug.h"
20 void ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
22 struct va_format vaf;
23 va_list args;
25 if (likely(!(common->debug_mask & dbg_mask)))
26 return;
28 va_start(args, fmt);
30 vaf.fmt = fmt;
31 vaf.va = &args;
33 printk(KERN_DEBUG "ath: %pV", &vaf);
35 va_end(args);
37 EXPORT_SYMBOL(ath_print);
39 const char *ath_opmode_to_string(enum nl80211_iftype opmode)
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:
63 return "UNKNOWN";
66 EXPORT_SYMBOL(ath_opmode_to_string);