aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
parentb2382b363df828f25e35ed8b70a3da33b29b2a64 (diff)
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 'include')
-rw-r--r--include/net/ieee80211.h37
1 files changed, 12 insertions, 25 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 51a20b5f3b5d..185423c6d22e 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -167,8 +167,19 @@ do { if (ieee80211_debug_level & (level)) \
167#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) 167#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
168#endif /* CONFIG_IEEE80211_DEBUG */ 168#endif /* CONFIG_IEEE80211_DEBUG */
169 169
170
171/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
172
173#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
174#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
175
176/* escape_essid() is intended to be used in debug (and possibly error)
177 * messages. It should never be used for passing essid to user space. */
178const char *escape_essid(const char *essid, u8 essid_len);
179
180
170/* 181/*
171 * To use the debug system; 182 * To use the debug system:
172 * 183 *
173 * If you are defining a new debug classification, simply add it to the #define 184 * If you are defining a new debug classification, simply add it to the #define
174 * list here in the form of: 185 * list here in the form of:
@@ -622,8 +633,6 @@ enum ieee80211_state {
622 633
623#define DEFAULT_MAX_SCAN_AGE (15 * HZ) 634#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
624#define DEFAULT_FTS 2346 635#define DEFAULT_FTS 2346
625#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
626#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
627 636
628 637
629#define CFG_IEEE80211_RESERVE_FCS (1<<0) 638#define CFG_IEEE80211_RESERVE_FCS (1<<0)
@@ -827,27 +836,5 @@ extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
827 return ieee->scans; 836 return ieee->scans;
828} 837}
829 838
830static inline const char *escape_essid(const char *essid, u8 essid_len) {
831 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
832 const char *s = essid;
833 char *d = escaped;
834
835 if (ieee80211_is_empty_essid(essid, essid_len)) {
836 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
837 return escaped;
838 }
839 839
840 essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
841 while (essid_len--) {
842 if (*s == '\0') {
843 *d++ = '\\';
844 *d++ = '0';
845 s++;
846 } else {
847 *d++ = *s++;
848 }
849 }
850 *d = '\0';
851 return escaped;
852}
853#endif /* IEEE80211_H */ 840#endif /* IEEE80211_H */