Commit aad74d84 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: Wrap ndo_do_ioctl() to prepare for DSA stacked ops

In preparation for adding another layer of call into a DSA stacked ops
singleton, wrap the ndo_do_ioctl() call into dev_do_ioctl().
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 88a3c454
...@@ -225,6 +225,22 @@ static int net_hwtstamp_validate(struct ifreq *ifr) ...@@ -225,6 +225,22 @@ static int net_hwtstamp_validate(struct ifreq *ifr)
return 0; return 0;
} }
static int dev_do_ioctl(struct net_device *dev,
struct ifreq *ifr, unsigned int cmd)
{
const struct net_device_ops *ops = dev->netdev_ops;
int err = -EOPNOTSUPP;
if (ops->ndo_do_ioctl) {
if (netif_device_present(dev))
err = ops->ndo_do_ioctl(dev, ifr, cmd);
else
err = -ENODEV;
}
return err;
}
/* /*
* Perform the SIOCxIFxxx calls, inside rtnl_lock() * Perform the SIOCxIFxxx calls, inside rtnl_lock()
*/ */
...@@ -323,13 +339,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) ...@@ -323,13 +339,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
cmd == SIOCSHWTSTAMP || cmd == SIOCSHWTSTAMP ||
cmd == SIOCGHWTSTAMP || cmd == SIOCGHWTSTAMP ||
cmd == SIOCWANDEV) { cmd == SIOCWANDEV) {
err = -EOPNOTSUPP; err = dev_do_ioctl(dev, ifr, cmd);
if (ops->ndo_do_ioctl) {
if (netif_device_present(dev))
err = ops->ndo_do_ioctl(dev, ifr, cmd);
else
err = -ENODEV;
}
} else } else
err = -EINVAL; err = -EINVAL;
......
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