diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-01-06 13:44:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-06 13:44:22 -0500 |
commit | 76288b4e573e06318fda65678052cfbde98fed1d (patch) | |
tree | 354a837a417cdc624c43fe99091fd73ae73eca36 /drivers/net | |
parent | 148bc4303f9ba972cbfe5d30dfec93ec0d8ff1e1 (diff) |
virtio: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/virtio_net.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index b7004ff36451..43f6523c40be 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -624,6 +624,18 @@ static int virtnet_change_mtu(struct net_device *dev, int new_mtu) | |||
624 | return 0; | 624 | return 0; |
625 | } | 625 | } |
626 | 626 | ||
627 | static const struct net_device_ops virtnet_netdev = { | ||
628 | .ndo_open = virtnet_open, | ||
629 | .ndo_stop = virtnet_close, | ||
630 | .ndo_start_xmit = start_xmit, | ||
631 | .ndo_validate_addr = eth_validate_addr, | ||
632 | .ndo_set_mac_address = eth_mac_addr, | ||
633 | .ndo_change_mtu = virtnet_change_mtu, | ||
634 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
635 | .ndo_poll_controller = virtnet_netpoll, | ||
636 | #endif | ||
637 | }; | ||
638 | |||
627 | static int virtnet_probe(struct virtio_device *vdev) | 639 | static int virtnet_probe(struct virtio_device *vdev) |
628 | { | 640 | { |
629 | int err; | 641 | int err; |
@@ -636,14 +648,8 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
636 | return -ENOMEM; | 648 | return -ENOMEM; |
637 | 649 | ||
638 | /* Set up network device as normal. */ | 650 | /* Set up network device as normal. */ |
639 | dev->open = virtnet_open; | 651 | dev->netdev_ops = &virtnet_netdev; |
640 | dev->stop = virtnet_close; | ||
641 | dev->hard_start_xmit = start_xmit; | ||
642 | dev->change_mtu = virtnet_change_mtu; | ||
643 | dev->features = NETIF_F_HIGHDMA; | 652 | dev->features = NETIF_F_HIGHDMA; |
644 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
645 | dev->poll_controller = virtnet_netpoll; | ||
646 | #endif | ||
647 | SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops); | 653 | SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops); |
648 | SET_NETDEV_DEV(dev, &vdev->dev); | 654 | SET_NETDEV_DEV(dev, &vdev->dev); |
649 | 655 | ||