aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Muehlenhoff <jmm@debian.org>2009-02-01 13:39:16 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-03 14:53:21 -0700
commit16910554f3687c96d572664efc55057668a3f1cf (patch)
tree4ee054103c38001baa2814e06922617c2495270a
parent96c5abd7f84272447a74c2a854c89f9cbd4018b2 (diff)
Staging: wlan-ng: Move wlan_mkprintstr() and wlan_hexchar() macros into prism2sta.c
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/wlan-ng/prism2sta.c27
-rw-r--r--drivers/staging/wlan-ng/wlan_compat.h27
2 files changed, 22 insertions, 32 deletions
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index b1e4a99f1da..eb29a0a1939 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -91,13 +91,30 @@
#include "prism2mgmt.h"
/*================================================================*/
-/* Local Constants */
-
-/*================================================================*/
/* Local Macros */
-/*================================================================*/
-/* Local Types */
+#define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a)))
+
+/* Create a string of printable chars from something that might not be */
+/* It's recommended that the str be 4*len + 1 bytes long */
+#define wlan_mkprintstr(buf, buflen, str, strlen) \
+{ \
+ int i = 0; \
+ int j = 0; \
+ memset(str, 0, (strlen)); \
+ for (i = 0; i < (buflen); i++) { \
+ if ( isprint((buf)[i]) ) { \
+ (str)[j] = (buf)[i]; \
+ j++; \
+ } else { \
+ (str)[j] = '\\'; \
+ (str)[j+1] = 'x'; \
+ (str)[j+2] = wlan_hexchar(((buf)[i] & 0xf0) >> 4); \
+ (str)[j+3] = wlan_hexchar(((buf)[i] & 0x0f)); \
+ j += 4; \
+ } \
+ } \
+}
/*================================================================*/
/* Local Static Definitions */
diff --git a/drivers/staging/wlan-ng/wlan_compat.h b/drivers/staging/wlan-ng/wlan_compat.h
index 5c91332d2f6..a7673fc0018 100644
--- a/drivers/staging/wlan-ng/wlan_compat.h
+++ b/drivers/staging/wlan-ng/wlan_compat.h
@@ -61,33 +61,6 @@
#define WLAN_LOG_DEBUG(l, s, args...)
/*=============================================================*/
-/*--- General Macros ------------------------------------------*/
-/*=============================================================*/
-
-#define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a)))
-
-/* Create a string of printable chars from something that might not be */
-/* It's recommended that the str be 4*len + 1 bytes long */
-#define wlan_mkprintstr(buf, buflen, str, strlen) \
-{ \
- int i = 0; \
- int j = 0; \
- memset(str, 0, (strlen)); \
- for (i = 0; i < (buflen); i++) { \
- if ( isprint((buf)[i]) ) { \
- (str)[j] = (buf)[i]; \
- j++; \
- } else { \
- (str)[j] = '\\'; \
- (str)[j+1] = 'x'; \
- (str)[j+2] = wlan_hexchar(((buf)[i] & 0xf0) >> 4); \
- (str)[j+3] = wlan_hexchar(((buf)[i] & 0x0f)); \
- j += 4; \
- } \
- } \
-}
-
-/*=============================================================*/
/*--- Variables -----------------------------------------------*/
/*=============================================================*/