Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220282
b: refs/heads/master
c: d5642d3
h: refs/heads/master
v: v3
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Oct 11, 2010
1 parent b532342 commit bdc11ab
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 92 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41c7f4167e1312dacfc514d8610dbaaa14cfaea5
refs/heads/master: d5642d3ba7b6609e93a688bb39bd5883a270e41f
24 changes: 12 additions & 12 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
#include <typedefs.h>
#include <osl.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <bcmutils.h>
#include <bcmendian.h>
#include <dngl_stats.h>
Expand Down Expand Up @@ -967,8 +969,6 @@ void print_buf(void *pbuf, int len, int bytes_per_line)
printf("\n");
}

#define strtoul(nptr, endptr, base) simple_strtoul((nptr), (endptr), (base))

/* Convert user's input in hex pattern to byte-size mask */
static int wl_pattern_atoh(char *src, char *dst)
{
Expand All @@ -986,7 +986,7 @@ static int wl_pattern_atoh(char *src, char *dst)
char num[3];
strncpy(num, src, 2);
num[2] = '\0';
dst[i] = (u8) strtoul(num, NULL, 16);
dst[i] = (u8) simple_strtoul(num, NULL, 16);
src += 2;
}
return i;
Expand Down Expand Up @@ -1015,7 +1015,7 @@ dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
arg_org = arg_save;
memcpy(arg_save, arg, strlen(arg) + 1);

argv[i] = bcmstrtok(&arg_save, " ", 0);
argv[i] = strsep(&arg_save, " ");

i = 0;
if (NULL == argv[i]) {
Expand All @@ -1032,7 +1032,7 @@ dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
pkt_filterp = (wl_pkt_filter_enable_t *) (buf + str_len + 1);

/* Parse packet filter id. */
enable_parm.id = htod32(strtoul(argv[i], NULL, 0));
enable_parm.id = htod32(simple_strtoul(argv[i], NULL, 0));

/* Parse enable/disable value. */
enable_parm.enable = htod32(enable);
Expand Down Expand Up @@ -1101,9 +1101,9 @@ void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
goto fail;
}

argv[i] = bcmstrtok(&arg_save, " ", 0);
argv[i] = strsep(&arg_save, " ");
while (argv[i++])
argv[i] = bcmstrtok(&arg_save, " ", 0);
argv[i] = strsep(&arg_save, " ");

i = 0;
if (NULL == argv[i]) {
Expand All @@ -1120,31 +1120,31 @@ void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
pkt_filterp = (wl_pkt_filter_t *) (buf + str_len + 1);

/* Parse packet filter id. */
pkt_filter.id = htod32(strtoul(argv[i], NULL, 0));
pkt_filter.id = htod32(simple_strtoul(argv[i], NULL, 0));

if (NULL == argv[++i]) {
DHD_ERROR(("Polarity not provided\n"));
goto fail;
}

/* Parse filter polarity. */
pkt_filter.negate_match = htod32(strtoul(argv[i], NULL, 0));
pkt_filter.negate_match = htod32(simple_strtoul(argv[i], NULL, 0));

if (NULL == argv[++i]) {
DHD_ERROR(("Filter type not provided\n"));
goto fail;
}

/* Parse filter type. */
pkt_filter.type = htod32(strtoul(argv[i], NULL, 0));
pkt_filter.type = htod32(simple_strtoul(argv[i], NULL, 0));

if (NULL == argv[++i]) {
DHD_ERROR(("Offset not provided\n"));
goto fail;
}

/* Parse pattern filter offset. */
pkt_filter.u.pattern.offset = htod32(strtoul(argv[i], NULL, 0));
pkt_filter.u.pattern.offset = htod32(simple_strtoul(argv[i], NULL, 0));

if (NULL == argv[++i]) {
DHD_ERROR(("Bitmask not provided\n"));
Expand Down Expand Up @@ -1290,7 +1290,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
ptr = buf;
bcm_mkiovar("ver", 0, 0, buf, sizeof(buf));
dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf));
bcmstrtok(&ptr, "\n", 0);
strsep(&ptr, "\n");
/* Print fw version info */
DHD_ERROR(("Firmware version = %s\n", buf));

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <typedefs.h>
#include <linuxver.h>
#include <osl.h>
#include <linux/kernel.h>

#include <bcmutils.h>
#include <bcmendian.h>
Expand Down Expand Up @@ -3588,7 +3589,6 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)

static s32 wl_pattern_atoh(s8 *src, s8 *dst)
{
#define strtoul(nptr, endptr, base) bcm_strtoul((nptr), (endptr), (base))
int i;
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
WL_ERR(("Mask invalid format. Needs to start with 0x\n"));
Expand All @@ -3603,7 +3603,7 @@ static s32 wl_pattern_atoh(s8 *src, s8 *dst)
char num[3];
strncpy(num, src, 2);
num[2] = '\0';
dst[i] = (u8) strtoul(num, NULL, 16);
dst[i] = (u8) simple_strtoul(num, NULL, 16);
src += 2;
}
return i;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/brcm80211/include/bcmutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
#define PKTPRIO_UPD 0x400 /* DSCP used to update VLAN prio */
#define PKTPRIO_DSCP 0x800 /* DSCP prio found */

char *bcmstrtok(char **string, const char *delimiters, char *tokdelim);
/* ethernet address */
extern char *bcm_ether_ntoa(const struct ether_addr *ea, char *buf);
extern int bcm_ether_atoe(char *p, struct ether_addr *ea);
Expand Down
76 changes: 0 additions & 76 deletions trunk/drivers/staging/brcm80211/util/bcmutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,79 +1117,3 @@ int bcm_bprintf(struct bcmstrbuf *b, const char *fmt, ...)
return r;
}

/****************************************************************************
* Function: bcmstrtok
*
* Purpose:
* Tokenizes a string. This function is conceptually similiar to ANSI C strtok(),
* but allows strToken() to be used by different strings or callers at the same
* time. Each call modifies '*string' by substituting a NULL character for the
* first delimiter that is encountered, and updates 'string' to point to the char
* after the delimiter. Leading delimiters are skipped.
*
* Parameters:
* string (mod) Ptr to string ptr, updated by token.
* delimiters (in) Set of delimiter characters.
* tokdelim (out) Character that delimits the returned token. (May
* be set to NULL if token delimiter is not required).
*
* Returns: Pointer to the next token found. NULL when no more tokens are found.
*****************************************************************************
*/
char *bcmstrtok(char **string, const char *delimiters, char *tokdelim)
{
unsigned char *str;
unsigned long map[8];
int count;
char *nextoken;

if (tokdelim != NULL) {
/* Prime the token delimiter */
*tokdelim = '\0';
}

/* Clear control map */
for (count = 0; count < 8; count++) {
map[count] = 0;
}

/* Set bits in delimiter table */
do {
map[*delimiters >> 5] |= (1 << (*delimiters & 31));
} while (*delimiters++);

str = (unsigned char *)*string;

/* Find beginning of token (skip over leading delimiters). Note that
* there is no token iff this loop sets str to point to the terminal
* null (*str == '\0')
*/
while (((map[*str >> 5] & (1 << (*str & 31))) && *str) || (*str == ' ')) {
str++;
}

nextoken = (char *)str;

/* Find the end of the token. If it is not the end of the string,
* put a null there.
*/
for (; *str; str++) {
if (map[*str >> 5] & (1 << (*str & 31))) {
if (tokdelim != NULL) {
*tokdelim = *str;
}

*str++ = '\0';
break;
}
}

*string = (char *)str;

/* Determine if a token has been found. */
if (nextoken == (char *)str) {
return NULL;
} else {
return nextoken;
}
}

0 comments on commit bdc11ab

Please sign in to comment.