]> git.ipfire.org Git - people/ms/linux.git/blobdiff - drivers/net/wan/wanxl.c
net: split out ndo_siowandev ioctl
[people/ms/linux.git] / drivers / net / wan / wanxl.c
index f22e48415e6f46c771e894685f1f8619f62ac612..5a9e262188efe1cbc8662437b8f0f76c2a03ca54 100644 (file)
@@ -343,20 +343,17 @@ static int wanxl_attach(struct net_device *dev, unsigned short encoding,
        return 0;
 }
 
-static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+static int wanxl_ioctl(struct net_device *dev, struct if_settings *ifs)
 {
        const size_t size = sizeof(sync_serial_settings);
        sync_serial_settings line;
        struct port *port = dev_to_port(dev);
 
-       if (cmd != SIOCWANDEV)
-               return hdlc_ioctl(dev, ifr, cmd);
-
-       switch (ifr->ifr_settings.type) {
+       switch (ifs->type) {
        case IF_GET_IFACE:
-               ifr->ifr_settings.type = IF_IFACE_SYNC_SERIAL;
-               if (ifr->ifr_settings.size < size) {
-                       ifr->ifr_settings.size = size; /* data size wanted */
+               ifs->type = IF_IFACE_SYNC_SERIAL;
+               if (ifs->size < size) {
+                       ifs->size = size; /* data size wanted */
                        return -ENOBUFS;
                }
                memset(&line, 0, sizeof(line));
@@ -364,7 +361,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                line.clock_rate = 0;
                line.loopback = 0;
 
-               if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &line, size))
+               if (copy_to_user(ifs->ifs_ifsu.sync, &line, size))
                        return -EFAULT;
                return 0;
 
@@ -374,7 +371,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                if (dev->flags & IFF_UP)
                        return -EBUSY;
 
-               if (copy_from_user(&line, ifr->ifr_settings.ifs_ifsu.sync,
+               if (copy_from_user(&line, ifs->ifs_ifsu.sync,
                                   size))
                        return -EFAULT;
 
@@ -389,7 +386,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                return 0;
 
        default:
-               return hdlc_ioctl(dev, ifr, cmd);
+               return hdlc_ioctl(dev, ifs);
        }
 }
 
@@ -545,7 +542,7 @@ static const struct net_device_ops wanxl_ops = {
        .ndo_open       = wanxl_open,
        .ndo_stop       = wanxl_close,
        .ndo_start_xmit = hdlc_start_xmit,
-       .ndo_do_ioctl   = wanxl_ioctl,
+       .ndo_siocwandev = wanxl_ioctl,
        .ndo_get_stats  = wanxl_get_stats,
 };