Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105762
b: refs/heads/master
c: a9ea3fc
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and Rusty Russell committed Jul 25, 2008
1 parent 9925c8a commit 5603241
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9953ca6cb757fb317bb7cdd2fcbf9b88312e241b
refs/heads/master: a9ea3fc6f2654a7407864fec983d1671d775b5ee
18 changes: 18 additions & 0 deletions trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
//#define DEBUG
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/module.h>
#include <linux/virtio.h>
#include <linux/virtio_net.h>
Expand Down Expand Up @@ -408,6 +409,22 @@ static int virtnet_close(struct net_device *dev)
return 0;
}

static int virtnet_set_tx_csum(struct net_device *dev, u32 data)
{
struct virtnet_info *vi = netdev_priv(dev);
struct virtio_device *vdev = vi->vdev;

if (data && !virtio_has_feature(vdev, VIRTIO_NET_F_CSUM))
return -ENOSYS;

return ethtool_op_set_tx_hw_csum(dev, data);
}

static struct ethtool_ops virtnet_ethtool_ops = {
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
};

static int virtnet_probe(struct virtio_device *vdev)
{
int err;
Expand All @@ -427,6 +444,7 @@ static int virtnet_probe(struct virtio_device *vdev)
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = virtnet_netpoll;
#endif
SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
SET_NETDEV_DEV(dev, &vdev->dev);

/* Do we support "hardware" checksums? */
Expand Down

0 comments on commit 5603241

Please sign in to comment.