summaryrefslogtreecommitdiffstats
path: root/net/ieee80211
diff options
context:
space:
mode:
authorJiri Benc <jbenc@suse.cz>2005-08-25 20:00:53 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-25 20:00:53 -0400
commite88187eedc0a9223914b23b063342db8bcc31f9c (patch)
treebbe79e548146565c0119f36b4e71599b63c6af4f /net/ieee80211
parentb2382b363df828f25e35ed8b70a3da33b29b2a64 (diff)
downloadop-kernel-dev-e88187eedc0a9223914b23b063342db8bcc31f9c.zip
op-kernel-dev-e88187eedc0a9223914b23b063342db8bcc31f9c.tar.gz
ieee80211: Puts debug macros together and makes escape_essid not inlined.
Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: Jirka Bohac <jbohac@suse.cz>
Diffstat (limited to 'net/ieee80211')
-rw-r--r--net/ieee80211/ieee80211_module.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index e0802b8..553acb2 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -269,5 +269,31 @@ module_exit(ieee80211_exit);
module_init(ieee80211_init);
#endif
+
+const char *escape_essid(const char *essid, u8 essid_len) {
+ static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
+ const char *s = essid;
+ char *d = escaped;
+
+ if (ieee80211_is_empty_essid(essid, essid_len)) {
+ memcpy(escaped, "<hidden>", sizeof("<hidden>"));
+ return escaped;
+ }
+
+ essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
+ while (essid_len--) {
+ if (*s == '\0') {
+ *d++ = '\\';
+ *d++ = '0';
+ s++;
+ } else {
+ *d++ = *s++;
+ }
+ }
+ *d = '\0';
+ return escaped;
+}
+
EXPORT_SYMBOL(alloc_ieee80211);
EXPORT_SYMBOL(free_ieee80211);
+EXPORT_SYMBOL(escape_essid);
OpenPOWER on IntegriCloud