diff options
author | John W. Linville <linville@tuxdriver.com> | 2008-09-24 18:13:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:46 -0400 |
commit | 7e272fcff6f0a32a3d46e600ea5895f6058f4e2d (patch) | |
tree | 39857028913862af4d71170d1f16ee360ba49115 /include/net/lib80211.h | |
parent | ddf4ac53fb8a12a027c0486db743ae040f45b56a (diff) |
wireless: consolidate on a single escape_essid implementation
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/lib80211.h')
-rw-r--r-- | include/net/lib80211.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/net/lib80211.h b/include/net/lib80211.h new file mode 100644 index 000000000000..91a64f358cef --- /dev/null +++ b/include/net/lib80211.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * lib80211.h -- common bits for IEEE802.11 wireless drivers | ||
3 | * | ||
4 | * Copyright (c) 2008, John W. Linville <linville@tuxdriver.com> | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef LIB80211_H | ||
9 | #define LIB80211_H | ||
10 | |||
11 | /* escape_ssid() is intended to be used in debug (and possibly error) | ||
12 | * messages. It should never be used for passing ssid to user space. */ | ||
13 | const char *escape_ssid(const char *ssid, u8 ssid_len); | ||
14 | |||
15 | static inline int is_empty_ssid(const char *ssid, int ssid_len) | ||
16 | { | ||
17 | /* Single white space is for Linksys APs */ | ||
18 | if (ssid_len == 1 && ssid[0] == ' ') | ||
19 | return 1; | ||
20 | |||
21 | /* Otherwise, if the entire ssid is 0, we assume it is hidden */ | ||
22 | while (ssid_len) { | ||
23 | ssid_len--; | ||
24 | if (ssid[ssid_len] != '\0') | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | return 1; | ||
29 | } | ||
30 | |||
31 | #endif /* LIB80211_H */ | ||