Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267440
b: refs/heads/master
c: 05b9261
h: refs/heads/master
v: v3
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 51ae335 commit 06a0edf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 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: 9917124f23210da0d07491b33e7eae004f908f78
refs/heads/master: 05b92610eef4646c252171d059a84c705b66ede5
27 changes: 21 additions & 6 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,13 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
return -EINVAL;
}
for (i = 0; *src != '\0'; i++) {
unsigned long res;
char num[3];
strncpy(num, src, 2);
num[2] = '\0';
dst[i] = (u8) simple_strtoul(num, NULL, 16);
if (kstrtoul(num, 16, &res))
return -EINVAL;
dst[i] = (u8)res;
src += 2;
}
return i;
Expand All @@ -840,6 +843,7 @@ void
brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
int master_mode)
{
unsigned long res;
char *argv[8];
int i = 0;
const char *str;
Expand Down Expand Up @@ -876,7 +880,9 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
pkt_filterp = (struct brcmf_pkt_filter_enable *) (buf + str_len + 1);

/* Parse packet filter id. */
enable_parm.id = simple_strtoul(argv[i], NULL, 0);
enable_parm.id = 0;
if (!kstrtoul(argv[i], 0, &res))
enable_parm.id = (u32)res;

/* Parse enable/disable value. */
enable_parm.enable = enable;
Expand Down Expand Up @@ -913,6 +919,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
const char *str;
struct brcmf_pkt_filter pkt_filter;
struct brcmf_pkt_filter *pkt_filterp;
unsigned long res;
int buf_len;
int str_len;
int rc;
Expand Down Expand Up @@ -956,31 +963,39 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
pkt_filterp = (struct brcmf_pkt_filter *) (buf + str_len + 1);

/* Parse packet filter id. */
pkt_filter.id = simple_strtoul(argv[i], NULL, 0);
pkt_filter.id = 0;
if (!kstrtoul(argv[i], 0, &res))
pkt_filter.id = (u32)res;

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

/* Parse filter polarity. */
pkt_filter.negate_match = simple_strtoul(argv[i], NULL, 0);
pkt_filter.negate_match = 0;
if (!kstrtoul(argv[i], 0, &res))
pkt_filter.negate_match = (u32)res;

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

/* Parse filter type. */
pkt_filter.type = simple_strtoul(argv[i], NULL, 0);
pkt_filter.type = 0;
if (!kstrtoul(argv[i], 0, &res))
pkt_filter.type = (u32)res;

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

/* Parse pattern filter offset. */
pkt_filter.u.pattern.offset = simple_strtoul(argv[i], NULL, 0);
pkt_filter.u.pattern.offset = 0;
if (!kstrtoul(argv[i], 0, &res))
pkt_filter.u.pattern.offset = (u32)res;

if (NULL == argv[++i]) {
BRCMF_ERROR(("Bitmask not provided\n"));
Expand Down

0 comments on commit 06a0edf

Please sign in to comment.