Skip to content

Commit

Permalink
staging: brcm80211: simplified brcmf_proto_ioctl()
Browse files Browse the repository at this point in the history
Removed a function parameter since it was redundant.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Sep 16, 2011
1 parent bb45076 commit 862c307
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,

int
brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
void *buf, int len)
int len)
{
struct brcmf_proto *prot = drvr->prot;
int ret = -1;
Expand All @@ -293,7 +293,7 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
(unsigned long)prot->lastcmd);
if ((ioc->cmd == BRCMF_C_SET_VAR) ||
(ioc->cmd == BRCMF_C_GET_VAR))
brcmf_dbg(TRACE, "iovar cmd=%s\n", (char *)buf);
brcmf_dbg(TRACE, "iovar cmd=%s\n", (char *)ioc->buf);

goto done;
}
Expand All @@ -302,10 +302,10 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
prot->lastcmd = ioc->cmd;
if (ioc->set)
ret = brcmf_proto_cdc_set_ioctl(drvr, ifidx, ioc->cmd,
buf, len);
ioc->buf, len);
else {
ret = brcmf_proto_cdc_query_ioctl(drvr, ifidx, ioc->cmd,
buf, len);
ioc->buf, len);
if (ret > 0)
ioc->used = ret - sizeof(struct brcmf_proto_cdc_ioctl);
}
Expand All @@ -321,12 +321,12 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,

/* Intercept the wme_dp ioctl here */
if (!ret && ioc->cmd == BRCMF_C_SET_VAR &&
!strcmp(buf, "wme_dp")) {
!strcmp(ioc->buf, "wme_dp")) {
int slen, val = 0;

slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int)))
memcpy(&val, (char *)buf + slen, sizeof(int));
memcpy(&val, (char *)ioc->buf + slen, sizeof(int));
drvr->wme_dp = (u8) le32_to_cpu(val);
}

Expand Down
17 changes: 8 additions & 9 deletions drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
ioc.len = buflen;
ioc.set = true;

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0) {
brcmf_dbg(ERROR, "%s: set mcast_list failed, cnt %d\n",
brcmf_ifname(&drvr_priv->pub, ifidx), cnt);
Expand Down Expand Up @@ -238,7 +238,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
ioc.len = buflen;
ioc.set = true;

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0) {
brcmf_dbg(ERROR, "%s: set allmulti %d failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx),
Expand All @@ -259,7 +259,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
ioc.len = sizeof(allmulti);
ioc.set = true;

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0) {
brcmf_dbg(ERROR, "%s: set promisc %d failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx),
Expand All @@ -286,7 +286,7 @@ _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *addr)
ioc.len = 32;
ioc.set = true;

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0)
brcmf_dbg(ERROR, "%s: set cur_etheraddr failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx));
Expand Down Expand Up @@ -718,7 +718,7 @@ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
ioc.set = false;

strcpy(buf, "toe_ol");
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0) {
/* Check for older dongle image that doesn't support toe_ol */
if (ret == -EIO) {
Expand Down Expand Up @@ -756,7 +756,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
strcpy(buf, "toe_ol");
memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(u32));

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0) {
brcmf_dbg(ERROR, "%s: could not set toe_ol: ret=%d\n",
brcmf_ifname(&drvr_priv->pub, ifidx), ret);
Expand All @@ -770,7 +770,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
strcpy(buf, "toe");
memcpy(&buf[sizeof("toe")], &toe, sizeof(u32));

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.len);
if (ret < 0) {
brcmf_dbg(ERROR, "%s: could not set toe: ret=%d\n",
brcmf_ifname(&drvr_priv->pub, ifidx), ret);
Expand Down Expand Up @@ -963,8 +963,7 @@ int brcmf_netdev_ioctl_priv(struct net_device *net, struct brcmf_ioctl *ioc)
if (is_set_key_cmd)
brcmf_netdev_wait_pend8021x(net);

bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx,
ioc, ioc->buf, buflen);
bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, ioc, buflen);

done:
if (bcmerror > 0)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmfmac/dhd_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,

/* Use protocol to issue ioctl to dongle */
extern int brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx,
struct brcmf_ioctl *ioc, void *buf, int len);
struct brcmf_ioctl *ioc, int len);

/* Update local copy of dongle statistics */
extern void brcmf_proto_dstats(struct brcmf_pub *drvr);
Expand Down

0 comments on commit 862c307

Please sign in to comment.