]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Staging: wlan-ng: Move wlan_mkprintstr() and wlan_hexchar() macros into prism2sta.c
authorMoritz Muehlenhoff <jmm@debian.org>
Sun, 1 Feb 2009 12:39:16 +0000 (13:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:21 +0000 (14:53 -0700)
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/wlan-ng/prism2sta.c
drivers/staging/wlan-ng/wlan_compat.h

index b1e4a99f1daaf8ffe31eddabb4f438fbe5a4db8a..eb29a0a1939389f37d5aaf843ebc14d6360f2327 100644 (file)
 #include "hfa384x.h"
 #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 */
index 5c91332d2f61a664ccee3b1151078465a01af134..a7673fc00189f25eab95639a2b8a4c3ffc090ae4 100644 (file)
 
 #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 -----------------------------------------------*/
 /*=============================================================*/