aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c10
-rw-r--r--drivers/net/wireless/ath/debug.c29
-rw-r--r--drivers/net/wireless/ath/debug.h3
3 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index c2d549f871f9..a342a9da1b3e 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -60,6 +60,7 @@
60 60
61#include "base.h" 61#include "base.h"
62#include "debug.h" 62#include "debug.h"
63#include "../debug.h"
63 64
64static unsigned int ath5k_debug; 65static unsigned int ath5k_debug;
65module_param_named(debug, ath5k_debug, uint, 0); 66module_param_named(debug, ath5k_debug, uint, 0);
@@ -492,6 +493,7 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
492 char buf[700]; 493 char buf[700];
493 unsigned int len = 0; 494 unsigned int len = 0;
494 u32 filt = ath5k_hw_get_rx_filter(sc->ah); 495 u32 filt = ath5k_hw_get_rx_filter(sc->ah);
496 const char *tmp;
495 497
496 len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n", 498 len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
497 sc->bssidmask); 499 sc->bssidmask);
@@ -524,6 +526,14 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
524 else 526 else
525 len += snprintf(buf+len, sizeof(buf)-len, "\n"); 527 len += snprintf(buf+len, sizeof(buf)-len, "\n");
526 528
529 tmp = ath_opmode_to_string(sc->opmode);
530 if (tmp)
531 len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n",
532 tmp);
533 else
534 len += snprintf(buf+len, sizeof(buf)-len,
535 "opmode: UNKNOWN-%i\n", sc->opmode);
536
527 if (len > sizeof(buf)) 537 if (len > sizeof(buf))
528 len = sizeof(buf); 538 len = sizeof(buf);
529 539
diff --git a/drivers/net/wireless/ath/debug.c b/drivers/net/wireless/ath/debug.c
index 53e77bd131b9..a9eb7876dbe1 100644
--- a/drivers/net/wireless/ath/debug.c
+++ b/drivers/net/wireless/ath/debug.c
@@ -30,3 +30,32 @@ void ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
30 va_end(args); 30 va_end(args);
31} 31}
32EXPORT_SYMBOL(ath_print); 32EXPORT_SYMBOL(ath_print);
33
34const char *ath_opmode_to_string(enum nl80211_iftype opmode)
35{
36 switch (opmode) {
37 case NL80211_IFTYPE_UNSPECIFIED:
38 return "UNSPEC";
39 case NL80211_IFTYPE_ADHOC:
40 return "ADHOC";
41 case NL80211_IFTYPE_STATION:
42 return "STATION";
43 case NL80211_IFTYPE_AP:
44 return "AP";
45 case NL80211_IFTYPE_AP_VLAN:
46 return "AP-VLAN";
47 case NL80211_IFTYPE_WDS:
48 return "WDS";
49 case NL80211_IFTYPE_MONITOR:
50 return "MONITOR";
51 case NL80211_IFTYPE_MESH_POINT:
52 return "MESH";
53 case NL80211_IFTYPE_P2P_CLIENT:
54 return "P2P-CLIENT";
55 case NL80211_IFTYPE_P2P_GO:
56 return "P2P-GO";
57 default:
58 return NULL;
59 }
60}
61EXPORT_SYMBOL(ath_opmode_to_string);
diff --git a/drivers/net/wireless/ath/debug.h b/drivers/net/wireless/ath/debug.h
index fd3a020682dc..a3a5a628d24d 100644
--- a/drivers/net/wireless/ath/debug.h
+++ b/drivers/net/wireless/ath/debug.h
@@ -77,4 +77,7 @@ ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...)
77} 77}
78#endif /* CONFIG_ATH_DEBUG */ 78#endif /* CONFIG_ATH_DEBUG */
79 79
80/** Returns string describing opmode, or NULL if unknown mode. */
81const char *ath_opmode_to_string(enum nl80211_iftype opmode);
82
80#endif /* ATH_DEBUG_H */ 83#endif /* ATH_DEBUG_H */