diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-20 00:50:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 01:42:39 -0500 |
commit | 4456e7bdf74c9f27e2312a6f197b2da467541433 (patch) | |
tree | 1b06ab44cb2002b6eb5ded43d857ebf3d3f188e1 /drivers | |
parent | a2dbb88210b9877f1c53d3798fd5d717a4d45256 (diff) |
veth: convert to net_device_ops
Convert to net_device_ops function table.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/veth.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 75b40fefc4ee..4f93a55aaaa5 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -262,16 +262,20 @@ static void veth_dev_free(struct net_device *dev) | |||
262 | free_netdev(dev); | 262 | free_netdev(dev); |
263 | } | 263 | } |
264 | 264 | ||
265 | static const struct net_device_ops veth_netdev_ops = { | ||
266 | .ndo_init = veth_dev_init, | ||
267 | .ndo_open = veth_open, | ||
268 | .ndo_get_stats = veth_get_stats, | ||
269 | }; | ||
270 | |||
265 | static void veth_setup(struct net_device *dev) | 271 | static void veth_setup(struct net_device *dev) |
266 | { | 272 | { |
267 | ether_setup(dev); | 273 | ether_setup(dev); |
268 | 274 | ||
275 | dev->netdev_ops = &veth_netdev_ops; | ||
269 | dev->hard_start_xmit = veth_xmit; | 276 | dev->hard_start_xmit = veth_xmit; |
270 | dev->get_stats = veth_get_stats; | ||
271 | dev->open = veth_open; | ||
272 | dev->ethtool_ops = &veth_ethtool_ops; | 277 | dev->ethtool_ops = &veth_ethtool_ops; |
273 | dev->features |= NETIF_F_LLTX; | 278 | dev->features |= NETIF_F_LLTX; |
274 | dev->init = veth_dev_init; | ||
275 | dev->destructor = veth_dev_free; | 279 | dev->destructor = veth_dev_free; |
276 | } | 280 | } |
277 | 281 | ||
@@ -297,7 +301,7 @@ static int veth_device_event(struct notifier_block *unused, | |||
297 | { | 301 | { |
298 | struct net_device *dev = ptr; | 302 | struct net_device *dev = ptr; |
299 | 303 | ||
300 | if (dev->open != veth_open) | 304 | if (dev->netdev_ops->ndo_open != veth_open) |
301 | goto out; | 305 | goto out; |
302 | 306 | ||
303 | switch (event) { | 307 | switch (event) { |