brcmfmac: change testmode command to use new firmware interface layer
authorHante Meuleman <meuleman@broadcom.com>
Mon, 22 Oct 2012 17:36:16 +0000 (10:36 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 29 Oct 2012 19:28:18 +0000 (15:28 -0400)
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>
drivers/net/wireless/brcm80211/brcmfmac/dhd.h
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

index c915d3362b422997779d767c7b81ac9c9edbcede..1589c1bfaa01c39bd8bdd81500db3c6e3d164460 100644 (file)
@@ -714,9 +714,6 @@ extern uint brcmf_c_mkiovar_bsscfg(char *name, char *data, uint datalen,
 
 extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
 
-extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len);
-extern int brcmf_netlink_dcmd(struct net_device *ndev, struct brcmf_dcmd *dcmd);
-
 /* Return pointer to interface name */
 extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
 
index 5f91fae5ebb18d0358976eea6930133e06f7fe86..c524b04efe5a208c178e5fdf8f72296e412d59ad 100644 (file)
@@ -706,60 +706,6 @@ static int brcmf_netdev_ioctl_entry(struct net_device *ndev, struct ifreq *ifr,
        return -EOPNOTSUPP;
 }
 
-/* called only from within this driver. Sends a command to the dongle. */
-s32 brcmf_exec_dcmd(struct net_device *ndev, u32 cmd, void *arg, u32 len)
-{
-       struct brcmf_dcmd dcmd;
-       s32 err = 0;
-       int buflen = 0;
-       bool is_set_key_cmd;
-       struct brcmf_if *ifp = netdev_priv(ndev);
-       struct brcmf_pub *drvr = ifp->drvr;
-
-       memset(&dcmd, 0, sizeof(dcmd));
-       dcmd.cmd = cmd;
-       dcmd.buf = arg;
-       dcmd.len = len;
-
-       if (dcmd.buf != NULL)
-               buflen = min_t(uint, dcmd.len, BRCMF_DCMD_MAXLEN);
-
-       /* send to dongle (must be up, and wl) */
-       if ((drvr->bus_if->state != BRCMF_BUS_DATA)) {
-               brcmf_dbg(ERROR, "DONGLE_DOWN\n");
-               err = -EIO;
-               goto done;
-       }
-
-       /*
-        * Intercept BRCMF_C_SET_KEY CMD - serialize M4 send and
-        * set key CMD to prevent M4 encryption.
-        */
-       is_set_key_cmd = ((dcmd.cmd == BRCMF_C_SET_KEY) ||
-                         ((dcmd.cmd == BRCMF_C_SET_VAR) &&
-                          !(strncmp("wsec_key", dcmd.buf, 9))) ||
-                         ((dcmd.cmd == BRCMF_C_SET_VAR) &&
-                          !(strncmp("bsscfg:wsec_key", dcmd.buf, 15))));
-       if (is_set_key_cmd)
-               brcmf_netdev_wait_pend8021x(ndev);
-
-       err = brcmf_proto_dcmd(drvr, ifp->idx, &dcmd, buflen);
-
-done:
-       if (err > 0)
-               err = 0;
-
-       return err;
-}
-
-int brcmf_netlink_dcmd(struct net_device *ndev, struct brcmf_dcmd *dcmd)
-{
-       brcmf_dbg(TRACE, "enter: cmd %x buf %p len %d\n",
-                 dcmd->cmd, dcmd->buf, dcmd->len);
-
-       return brcmf_exec_dcmd(ndev, dcmd->cmd, dcmd->buf, dcmd->len);
-}
-
 static int brcmf_netdev_stop(struct net_device *ndev)
 {
        struct brcmf_if *ifp = netdev_priv(ndev);
index 0beb2c6db2a064952eb88ec17099fade63c09a67..d354b2afe5419c93607b07de76e10c52249400c3 100644 (file)
@@ -3458,7 +3458,15 @@ static int brcmf_cfg80211_testmode(struct wiphy *wiphy, void *data, int len)
        struct sk_buff *reply;
        int ret;
 
-       ret = brcmf_netlink_dcmd(ndev, dcmd);
+       WL_TRACE("cmd %x set %d buf %p len %d\n", dcmd->cmd, dcmd->set,
+                dcmd->buf, dcmd->len);
+
+       if (dcmd->set)
+               ret = brcmf_fil_cmd_data_set(ndev, dcmd->cmd, dcmd->buf,
+                                            dcmd->len);
+       else
+               ret = brcmf_fil_cmd_data_get(ndev, dcmd->cmd, dcmd->buf,
+                                            dcmd->len);
        if (ret == 0) {
                reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*dcmd));
                nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*dcmd), dcmd);