]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: brcm80211: separated public from private ioctl functions
authorRoland Vossen <rvossen@broadcom.com>
Tue, 13 Sep 2011 07:49:53 +0000 (09:49 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Sep 2011 18:41:54 +0000 (20:41 +0200)
net_device ioctl handler was called both by the OS as by the driver
itself. Split the ioctl handler into two functions to make code paths
more clear.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/dhd.h
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c

index 9f84837cb54ce0294e23c9b78a84e7109910a267..93a1bfc85c31423a08d5b5a06178cdfb998b9256 100644 (file)
@@ -715,6 +715,8 @@ extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
 extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
 extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
 
+extern int brcmf_netdev_ioctl_priv(struct net_device *net, struct ifreq *ifr);
+
 /* Indication from bus module regarding removal/absence of dongle */
 extern void brcmf_detach(struct brcmf_pub *drvr);
 
index cfdd64590d94c6763a5e43383898b79874b5e525..4bc231e5e5d3a242e51d46b3599e73e4c4be55f4 100644 (file)
@@ -950,13 +950,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
                                    int cmd)
 {
        struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
-       struct brcmf_c_ioctl ioc;
-       int bcmerror = 0;
-       int buflen = 0;
-       void *buf = NULL;
-       uint driver = 0;
        int ifidx;
-       bool is_set_key_cmd;
 
        ifidx = brcmf_net2idx(drvr_priv, net);
        brcmf_dbg(TRACE, "ifidx %d, cmd 0x%04x\n", ifidx, cmd);
@@ -967,8 +961,22 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
        if (cmd == SIOCETHTOOL)
                return brcmf_ethtool(drvr_priv, ifr->ifr_data);
 
-       if (cmd != SIOCDEVPRIVATE)
-               return -EOPNOTSUPP;
+       return -EOPNOTSUPP;
+}
+
+/* called only from within this driver, handles cmd == SIOCDEVPRIVATE */
+int brcmf_netdev_ioctl_priv(struct net_device *net, struct ifreq *ifr)
+{
+       struct brcmf_c_ioctl ioc;
+       int bcmerror = 0;
+       int buflen = 0;
+       void *buf = NULL;
+       uint driver = 0;
+       bool is_set_key_cmd;
+       struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+       int ifidx;
+
+       ifidx = brcmf_net2idx(drvr_priv, net);
 
        memset(&ioc, 0, sizeof(ioc));
 
index 198f0cc1ebe7543b37bae584282f435697acd9b5..3fa0c1b8990d7328680888192bbf147271f6d5a2 100644 (file)
@@ -286,7 +286,7 @@ brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
 
        fs = get_fs();
        set_fs(get_ds());
-       err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+       err = brcmf_netdev_ioctl_priv(dev, &ifr);
        set_fs(fs);
 
        return err;