From cc314b71c81c74148560a6c33667df7fa389178f Mon Sep 17 00:00:00 2001 From: Moritz Muehlenhoff Date: Sun, 1 Feb 2009 13:39:16 +0100 Subject: [PATCH] --- yaml --- r: 141192 b: refs/heads/master c: 16910554f3687c96d572664efc55057668a3f1cf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/staging/wlan-ng/prism2sta.c | 27 +++++++++++++++++---- trunk/drivers/staging/wlan-ng/wlan_compat.h | 27 --------------------- 3 files changed, 23 insertions(+), 33 deletions(-) diff --git a/[refs] b/[refs] index 85d1779504f9..8f2fdfa91f68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 96c5abd7f84272447a74c2a854c89f9cbd4018b2 +refs/heads/master: 16910554f3687c96d572664efc55057668a3f1cf diff --git a/trunk/drivers/staging/wlan-ng/prism2sta.c b/trunk/drivers/staging/wlan-ng/prism2sta.c index b1e4a99f1daa..eb29a0a19393 100644 --- a/trunk/drivers/staging/wlan-ng/prism2sta.c +++ b/trunk/drivers/staging/wlan-ng/prism2sta.c @@ -90,14 +90,31 @@ #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 */ diff --git a/trunk/drivers/staging/wlan-ng/wlan_compat.h b/trunk/drivers/staging/wlan-ng/wlan_compat.h index 5c91332d2f61..a7673fc00189 100644 --- a/trunk/drivers/staging/wlan-ng/wlan_compat.h +++ b/trunk/drivers/staging/wlan-ng/wlan_compat.h @@ -60,33 +60,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 -----------------------------------------------*/ /*=============================================================*/