]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/virtio_net.c
[ARM] OMAP3: update ES level flags to discriminate between post-ES2 revisions
[linux-2.6-omap-h63xx.git] / drivers / net / virtio_net.c
index b7004ff36451764278e47eac267ffb4cd6bcd4bf..63ef2a8905fb1b836061882e5ff2ff2ac46f9d91 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/virtio.h>
 #include <linux/virtio_net.h>
 #include <linux/scatterlist.h>
+#include <linux/if_vlan.h>
 
 static int napi_weight = 128;
 module_param(napi_weight, int, 0444);
@@ -33,7 +34,7 @@ module_param(csum, bool, 0444);
 module_param(gso, bool, 0444);
 
 /* FIXME: MTU in config. */
-#define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN)
+#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN)
 #define GOOD_COPY_LEN  128
 
 struct virtnet_info
@@ -624,6 +625,18 @@ static int virtnet_change_mtu(struct net_device *dev, int new_mtu)
        return 0;
 }
 
+static const struct net_device_ops virtnet_netdev = {
+       .ndo_open            = virtnet_open,
+       .ndo_stop            = virtnet_close,
+       .ndo_start_xmit      = start_xmit,
+       .ndo_validate_addr   = eth_validate_addr,
+       .ndo_set_mac_address = eth_mac_addr,
+       .ndo_change_mtu      = virtnet_change_mtu,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller = virtnet_netpoll,
+#endif
+};
+
 static int virtnet_probe(struct virtio_device *vdev)
 {
        int err;
@@ -636,14 +649,8 @@ static int virtnet_probe(struct virtio_device *vdev)
                return -ENOMEM;
 
        /* Set up network device as normal. */
-       dev->open = virtnet_open;
-       dev->stop = virtnet_close;
-       dev->hard_start_xmit = start_xmit;
-       dev->change_mtu = virtnet_change_mtu;
+       dev->netdev_ops = &virtnet_netdev;
        dev->features = NETIF_F_HIGHDMA;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = virtnet_netpoll;
-#endif
        SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
        SET_NETDEV_DEV(dev, &vdev->dev);