Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266774
b: refs/heads/master
c: 1062904
h: refs/heads/master
v: v3
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Oct 14, 2011
1 parent 4b8e0bb commit 587fd4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: b5036243c122996d524235536542187dd3138aee
refs/heads/master: 1062904c9b053ed4f2b77900aacc122f68febb0b
15 changes: 8 additions & 7 deletions trunk/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev)
static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
{
struct brcmf_dcmd dcmd;
__le32 toe_le;
char buf[32];
int ret;

Expand All @@ -584,7 +585,8 @@ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
return ret;
}

memcpy(toe_ol, buf, sizeof(u32));
memcpy(&toe_le, buf, sizeof(u32));
*toe_ol = le32_to_cpu(toe_le);
return 0;
}

Expand All @@ -594,7 +596,8 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
{
struct brcmf_dcmd dcmd;
char buf[32];
int toe, ret;
int ret;
__le32 toe_le = cpu_to_le32(toe_ol);

memset(&dcmd, 0, sizeof(dcmd));

Expand All @@ -604,9 +607,8 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
dcmd.set = true;

/* Set toe_ol as requested */

strcpy(buf, "toe_ol");
memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(u32));
memcpy(&buf[sizeof("toe_ol")], &toe_le, sizeof(u32));

ret = brcmf_proto_dcmd(&drvr_priv->pub, ifidx, &dcmd, dcmd.len);
if (ret < 0) {
Expand All @@ -616,11 +618,10 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
}

/* Enable toe globally only if any components are enabled. */

toe = (toe_ol != 0);
toe_le = cpu_to_le32(toe_ol != 0);

strcpy(buf, "toe");
memcpy(&buf[sizeof("toe")], &toe, sizeof(u32));
memcpy(&buf[sizeof("toe")], &toe_le, sizeof(u32));

ret = brcmf_proto_dcmd(&drvr_priv->pub, ifidx, &dcmd, dcmd.len);
if (ret < 0) {
Expand Down

0 comments on commit 587fd4c

Please sign in to comment.