aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHante Meuleman <meuleman@broadcom.com>2012-10-22 13:36:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-29 15:28:18 -0400
commitf368a5b6015c501fa291df81b52811be189b82ee (patch)
treed7789cddf0701ba5dc4b36d4f3eaf7df915f381d
parent91917c77d229be369df007e6a6f5638bca26cc2b (diff)
brcmfmac: change testmode command to use new firmware interface layer
switch to new firmware interface layer and remove redundant code. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd.h3
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c54
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c10
3 files changed, 9 insertions, 58 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
index c915d3362b42..1589c1bfaa01 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
@@ -714,9 +714,6 @@ extern uint brcmf_c_mkiovar_bsscfg(char *name, char *data, uint datalen,
714 714
715extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev); 715extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
716 716
717extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len);
718extern int brcmf_netlink_dcmd(struct net_device *ndev, struct brcmf_dcmd *dcmd);
719
720/* Return pointer to interface name */ 717/* Return pointer to interface name */
721extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx); 718extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
722 719
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index 5f91fae5ebb1..c524b04efe5a 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -706,60 +706,6 @@ static int brcmf_netdev_ioctl_entry(struct net_device *ndev, struct ifreq *ifr,
706 return -EOPNOTSUPP; 706 return -EOPNOTSUPP;
707} 707}
708 708
709/* called only from within this driver. Sends a command to the dongle. */
710s32 brcmf_exec_dcmd(struct net_device *ndev, u32 cmd, void *arg, u32 len)
711{
712 struct brcmf_dcmd dcmd;
713 s32 err = 0;
714 int buflen = 0;
715 bool is_set_key_cmd;
716 struct brcmf_if *ifp = netdev_priv(ndev);
717 struct brcmf_pub *drvr = ifp->drvr;
718
719 memset(&dcmd, 0, sizeof(dcmd));
720 dcmd.cmd = cmd;
721 dcmd.buf = arg;
722 dcmd.len = len;
723
724 if (dcmd.buf != NULL)
725 buflen = min_t(uint, dcmd.len, BRCMF_DCMD_MAXLEN);
726
727 /* send to dongle (must be up, and wl) */
728 if ((drvr->bus_if->state != BRCMF_BUS_DATA)) {
729 brcmf_dbg(ERROR, "DONGLE_DOWN\n");
730 err = -EIO;
731 goto done;
732 }
733
734 /*
735 * Intercept BRCMF_C_SET_KEY CMD - serialize M4 send and
736 * set key CMD to prevent M4 encryption.
737 */
738 is_set_key_cmd = ((dcmd.cmd == BRCMF_C_SET_KEY) ||
739 ((dcmd.cmd == BRCMF_C_SET_VAR) &&
740 !(strncmp("wsec_key", dcmd.buf, 9))) ||
741 ((dcmd.cmd == BRCMF_C_SET_VAR) &&
742 !(strncmp("bsscfg:wsec_key", dcmd.buf, 15))));
743 if (is_set_key_cmd)
744 brcmf_netdev_wait_pend8021x(ndev);
745
746 err = brcmf_proto_dcmd(drvr, ifp->idx, &dcmd, buflen);
747
748done:
749 if (err > 0)
750 err = 0;
751
752 return err;
753}
754
755int brcmf_netlink_dcmd(struct net_device *ndev, struct brcmf_dcmd *dcmd)
756{
757 brcmf_dbg(TRACE, "enter: cmd %x buf %p len %d\n",
758 dcmd->cmd, dcmd->buf, dcmd->len);
759
760 return brcmf_exec_dcmd(ndev, dcmd->cmd, dcmd->buf, dcmd->len);
761}
762
763static int brcmf_netdev_stop(struct net_device *ndev) 709static int brcmf_netdev_stop(struct net_device *ndev)
764{ 710{
765 struct brcmf_if *ifp = netdev_priv(ndev); 711 struct brcmf_if *ifp = netdev_priv(ndev);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 0beb2c6db2a0..d354b2afe541 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3458,7 +3458,15 @@ static int brcmf_cfg80211_testmode(struct wiphy *wiphy, void *data, int len)
3458 struct sk_buff *reply; 3458 struct sk_buff *reply;
3459 int ret; 3459 int ret;
3460 3460
3461 ret = brcmf_netlink_dcmd(ndev, dcmd); 3461 WL_TRACE("cmd %x set %d buf %p len %d\n", dcmd->cmd, dcmd->set,
3462 dcmd->buf, dcmd->len);
3463
3464 if (dcmd->set)
3465 ret = brcmf_fil_cmd_data_set(ndev, dcmd->cmd, dcmd->buf,
3466 dcmd->len);
3467 else
3468 ret = brcmf_fil_cmd_data_get(ndev, dcmd->cmd, dcmd->buf,
3469 dcmd->len);
3462 if (ret == 0) { 3470 if (ret == 0) {
3463 reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*dcmd)); 3471 reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*dcmd));
3464 nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*dcmd), dcmd); 3472 nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*dcmd), dcmd);