Commit 862c307f authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: simplified brcmf_proto_ioctl()

Removed a function parameter since it was redundant.
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bb450766
...@@ -271,7 +271,7 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd, ...@@ -271,7 +271,7 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
int int
brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc, 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; struct brcmf_proto *prot = drvr->prot;
int ret = -1; int ret = -1;
...@@ -293,7 +293,7 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc, ...@@ -293,7 +293,7 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
(unsigned long)prot->lastcmd); (unsigned long)prot->lastcmd);
if ((ioc->cmd == BRCMF_C_SET_VAR) || if ((ioc->cmd == BRCMF_C_SET_VAR) ||
(ioc->cmd == BRCMF_C_GET_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; goto done;
} }
...@@ -302,10 +302,10 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc, ...@@ -302,10 +302,10 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
prot->lastcmd = ioc->cmd; prot->lastcmd = ioc->cmd;
if (ioc->set) if (ioc->set)
ret = brcmf_proto_cdc_set_ioctl(drvr, ifidx, ioc->cmd, ret = brcmf_proto_cdc_set_ioctl(drvr, ifidx, ioc->cmd,
buf, len); ioc->buf, len);
else { else {
ret = brcmf_proto_cdc_query_ioctl(drvr, ifidx, ioc->cmd, ret = brcmf_proto_cdc_query_ioctl(drvr, ifidx, ioc->cmd,
buf, len); ioc->buf, len);
if (ret > 0) if (ret > 0)
ioc->used = ret - sizeof(struct brcmf_proto_cdc_ioctl); ioc->used = ret - sizeof(struct brcmf_proto_cdc_ioctl);
} }
...@@ -321,12 +321,12 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc, ...@@ -321,12 +321,12 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
/* Intercept the wme_dp ioctl here */ /* Intercept the wme_dp ioctl here */
if (!ret && ioc->cmd == BRCMF_C_SET_VAR && if (!ret && ioc->cmd == BRCMF_C_SET_VAR &&
!strcmp(buf, "wme_dp")) { !strcmp(ioc->buf, "wme_dp")) {
int slen, val = 0; int slen, val = 0;
slen = strlen("wme_dp") + 1; slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int))) 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); drvr->wme_dp = (u8) le32_to_cpu(val);
} }
......
...@@ -200,7 +200,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx) ...@@ -200,7 +200,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
ioc.len = buflen; ioc.len = buflen;
ioc.set = true; 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) { if (ret < 0) {
brcmf_dbg(ERROR, "%s: set mcast_list failed, cnt %d\n", brcmf_dbg(ERROR, "%s: set mcast_list failed, cnt %d\n",
brcmf_ifname(&drvr_priv->pub, ifidx), cnt); brcmf_ifname(&drvr_priv->pub, ifidx), cnt);
...@@ -238,7 +238,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx) ...@@ -238,7 +238,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
ioc.len = buflen; ioc.len = buflen;
ioc.set = true; 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) { if (ret < 0) {
brcmf_dbg(ERROR, "%s: set allmulti %d failed\n", brcmf_dbg(ERROR, "%s: set allmulti %d failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx), brcmf_ifname(&drvr_priv->pub, ifidx),
...@@ -259,7 +259,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx) ...@@ -259,7 +259,7 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
ioc.len = sizeof(allmulti); ioc.len = sizeof(allmulti);
ioc.set = true; 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) { if (ret < 0) {
brcmf_dbg(ERROR, "%s: set promisc %d failed\n", brcmf_dbg(ERROR, "%s: set promisc %d failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx), brcmf_ifname(&drvr_priv->pub, ifidx),
...@@ -286,7 +286,7 @@ _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *addr) ...@@ -286,7 +286,7 @@ _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *addr)
ioc.len = 32; ioc.len = 32;
ioc.set = true; 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) if (ret < 0)
brcmf_dbg(ERROR, "%s: set cur_etheraddr failed\n", brcmf_dbg(ERROR, "%s: set cur_etheraddr failed\n",
brcmf_ifname(&drvr_priv->pub, ifidx)); brcmf_ifname(&drvr_priv->pub, ifidx));
...@@ -718,7 +718,7 @@ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol) ...@@ -718,7 +718,7 @@ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
ioc.set = false; ioc.set = false;
strcpy(buf, "toe_ol"); 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) { if (ret < 0) {
/* Check for older dongle image that doesn't support toe_ol */ /* Check for older dongle image that doesn't support toe_ol */
if (ret == -EIO) { if (ret == -EIO) {
...@@ -756,7 +756,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol) ...@@ -756,7 +756,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
strcpy(buf, "toe_ol"); strcpy(buf, "toe_ol");
memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(u32)); 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) { if (ret < 0) {
brcmf_dbg(ERROR, "%s: could not set toe_ol: ret=%d\n", brcmf_dbg(ERROR, "%s: could not set toe_ol: ret=%d\n",
brcmf_ifname(&drvr_priv->pub, ifidx), ret); brcmf_ifname(&drvr_priv->pub, ifidx), ret);
...@@ -770,7 +770,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol) ...@@ -770,7 +770,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
strcpy(buf, "toe"); strcpy(buf, "toe");
memcpy(&buf[sizeof("toe")], &toe, sizeof(u32)); 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) { if (ret < 0) {
brcmf_dbg(ERROR, "%s: could not set toe: ret=%d\n", brcmf_dbg(ERROR, "%s: could not set toe: ret=%d\n",
brcmf_ifname(&drvr_priv->pub, ifidx), ret); brcmf_ifname(&drvr_priv->pub, ifidx), ret);
...@@ -963,8 +963,7 @@ int brcmf_netdev_ioctl_priv(struct net_device *net, struct brcmf_ioctl *ioc) ...@@ -963,8 +963,7 @@ int brcmf_netdev_ioctl_priv(struct net_device *net, struct brcmf_ioctl *ioc)
if (is_set_key_cmd) if (is_set_key_cmd)
brcmf_netdev_wait_pend8021x(net); brcmf_netdev_wait_pend8021x(net);
bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, ioc, buflen);
ioc, ioc->buf, buflen);
done: done:
if (bcmerror > 0) if (bcmerror > 0)
......
...@@ -50,7 +50,7 @@ extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx, ...@@ -50,7 +50,7 @@ extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,
/* Use protocol to issue ioctl to dongle */ /* Use protocol to issue ioctl to dongle */
extern int brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, 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 */ /* Update local copy of dongle statistics */
extern void brcmf_proto_dstats(struct brcmf_pub *drvr); extern void brcmf_proto_dstats(struct brcmf_pub *drvr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment