netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>
Subject: vlan 03/07: Add ethtool support
Date: Mon,  7 Jul 2008 14:36:02 +0200 (MEST)	[thread overview]
Message-ID: <20080707123601.23947.96915.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080707123557.23947.70114.sendpatchset@localhost.localdomain>

vlan: Add ethtool support

Add ethtool support for querying the device for offload settings.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 0dba2d1f208d01290f0ea2d19a201f06da80dded
tree 568a86a3ccd0e587675607caa2f5d66fd526eaa3
parent 5d835c9df8f14434867d206073316f771cfaac48
author Patrick McHardy <kaber@trash.net> Mon, 07 Jul 2008 14:26:43 +0200
committer Patrick McHardy <kaber@trash.net> Mon, 07 Jul 2008 14:26:43 +0200

 net/8021q/vlan_dev.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 88f318a..722697d 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -28,6 +28,7 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/ethtool.h>
 #include <net/datalink.h>
 #include <net/p8022.h>
 #include <net/arp.h>
@@ -716,6 +717,22 @@ static void vlan_dev_uninit(struct net_device *dev)
 	}
 }
 
+static u32 vlan_ethtool_get_rx_csum(struct net_device *dev)
+{
+	const struct vlan_dev_info *vlan = vlan_dev_info(dev);
+	struct net_device *real_dev = vlan->real_dev;
+
+	if (real_dev->ethtool_ops == NULL ||
+	    real_dev->ethtool_ops->get_rx_csum == NULL)
+		return 0;
+	return real_dev->ethtool_ops->get_rx_csum(real_dev);
+}
+
+static const struct ethtool_ops vlan_ethtool_ops = {
+	.get_link		= ethtool_op_get_link,
+	.get_rx_csum		= vlan_ethtool_get_rx_csum,
+};
+
 void vlan_setup(struct net_device *dev)
 {
 	ether_setup(dev);
@@ -734,6 +751,7 @@ void vlan_setup(struct net_device *dev)
 	dev->change_rx_flags	= vlan_dev_change_rx_flags;
 	dev->do_ioctl		= vlan_dev_ioctl;
 	dev->destructor		= free_netdev;
+	dev->ethtool_ops	= &vlan_ethtool_ops;
 
 	memset(dev->broadcast, 0, ETH_ALEN);
 }

  parent reply	other threads:[~2008-07-07 12:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07 12:35 vlan 00/07: VLAN update part 1 Patrick McHardy
2008-07-07 12:35 ` vlan 01/07: fix network_header/mac_header adjustments Patrick McHardy
2008-07-07 12:36 ` vlan 02/07: Use is_vlan_dev() Patrick McHardy
2008-07-07 12:36 ` Patrick McHardy [this message]
2008-07-07 16:52   ` vlan 03/07: Add ethtool support Ben Hutchings
2008-07-07 16:59     ` Patrick McHardy
2008-07-07 17:21       ` Ben Hutchings
2008-07-07 17:47         ` Patrick McHardy
2008-07-08 13:54           ` Ben Hutchings
2008-07-08 14:01             ` Patrick McHardy
2008-07-07 12:36 ` vlan 04/07: uninline __vlan_hwaccel_rx Patrick McHardy
2008-07-07 12:36 ` vlan 05/07: move struct vlan_dev_info to private header Patrick McHardy
2008-07-07 12:36 ` vlan 06/07: remove useless struct hlist_node declaration from if_vlan.h Patrick McHardy
2008-07-07 12:36 ` vlan 07/07: TCI related type and naming cleanups Patrick McHardy
2008-07-08 10:44 ` vlan 00/07: VLAN update part 1 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080707123601.23947.96915.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).