summaryrefslogtreecommitdiff
path: root/include/net/lib80211.h
blob: 91a64f358cef57fcdfb95bb360aba96d3f7f2ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * lib80211.h -- common bits for IEEE802.11 wireless drivers
 *
 * Copyright (c) 2008, John W. Linville <linville@tuxdriver.com>
 *
 */

#ifndef LIB80211_H
#define LIB80211_H

/* escape_ssid() is intended to be used in debug (and possibly error)
 * messages. It should never be used for passing ssid to user space. */
const char *escape_ssid(const char *ssid, u8 ssid_len);

static inline int is_empty_ssid(const char *ssid, int ssid_len)
{
	/* Single white space is for Linksys APs */
	if (ssid_len == 1 && ssid[0] == ' ')
		return 1;

	/* Otherwise, if the entire ssid is 0, we assume it is hidden */
	while (ssid_len) {
		ssid_len--;
		if (ssid[ssid_len] != '\0')
			return 0;
	}

	return 1;
}

#endif /* LIB80211_H */