Commit 4456e7bd authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

veth: convert to net_device_ops

Convert to net_device_ops function table.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a2dbb882
...@@ -262,16 +262,20 @@ static void veth_dev_free(struct net_device *dev) ...@@ -262,16 +262,20 @@ static void veth_dev_free(struct net_device *dev)
free_netdev(dev); free_netdev(dev);
} }
static const struct net_device_ops veth_netdev_ops = {
.ndo_init = veth_dev_init,
.ndo_open = veth_open,
.ndo_get_stats = veth_get_stats,
};
static void veth_setup(struct net_device *dev) static void veth_setup(struct net_device *dev)
{ {
ether_setup(dev); ether_setup(dev);
dev->netdev_ops = &veth_netdev_ops;
dev->hard_start_xmit = veth_xmit; dev->hard_start_xmit = veth_xmit;
dev->get_stats = veth_get_stats;
dev->open = veth_open;
dev->ethtool_ops = &veth_ethtool_ops; dev->ethtool_ops = &veth_ethtool_ops;
dev->features |= NETIF_F_LLTX; dev->features |= NETIF_F_LLTX;
dev->init = veth_dev_init;
dev->destructor = veth_dev_free; dev->destructor = veth_dev_free;
} }
...@@ -297,7 +301,7 @@ static int veth_device_event(struct notifier_block *unused, ...@@ -297,7 +301,7 @@ static int veth_device_event(struct notifier_block *unused,
{ {
struct net_device *dev = ptr; struct net_device *dev = ptr;
if (dev->open != veth_open) if (dev->netdev_ops->ndo_open != veth_open)
goto out; goto out;
switch (event) { switch (event) {
......
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