All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] xennet_get_drvinfo()
Date: Thu, 11 Nov 2010 19:03:47 +0100	[thread overview]
Message-ID: <4CDC3003.5040306@redhat.com> (raw)

The following patch, written for xen/next-2.6.32, adds get_drvinfo() ("ethtool -i") support to netfront. If there is no default get_drvinfo() in effect [0], then the patch is intended to remedy the following situation:

  # ethtool -i eth0
  Cannot get driver information: Operation not supported

like this:

  # ethtool -i eth0
  driver: xen-netfront
  version:
  firmware-version:
  bus-info: vif-0

If a default get_drvinfo() is in effect (see [0] again), then the fallback works like this:

  # ethtool -i eth0
  driver: vif
  version:
  firmware-version:
  bus-info: vif-0

and it's more fortunate to return the module name ("driver: xen-netfront") than "driver: vif".

Thanks for considering,
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

[0] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=01414802054c382072b6cb9a1bdc6e243c74b2d5#patch17

---
 drivers/net/xen-netfront.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3f71199..64ee838 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1768,8 +1768,17 @@ static int xennet_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
+static void xennet_get_drvinfo(struct net_device *dev,
+			       struct ethtool_drvinfo *info)
+{
+	strcpy(info->driver, "xen-netfront");
+	strlcpy(info->bus_info, dev_name(dev->dev.parent),
+		sizeof info->bus_info);
+}
+
 static const struct ethtool_ops xennet_ethtool_ops =
 {
+	.get_drvinfo = xennet_get_drvinfo,
 	.set_tx_csum = ethtool_op_set_tx_csum,
 	.set_sg = xennet_set_sg,
 	.set_tso = xennet_set_tso,

             reply	other threads:[~2010-11-11 18:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 18:03 Laszlo Ersek [this message]
2010-11-11 18:50 ` [PATCH] xennet_get_drvinfo() Ian Campbell
2010-11-24 20:37   ` Jeremy Fitzhardinge
2010-11-24 20:47     ` Laszlo Ersek
2010-11-24 20:56       ` Jeremy Fitzhardinge
2010-11-24 21:37         ` VGA console low power mode in Xen Carsten Schiers
2010-11-25 10:56           ` Stefano Stabellini
2010-11-25 10:17         ` [PATCH] xennet_get_drvinfo() Ian Campbell
2010-11-25 19:15           ` Jeremy Fitzhardinge

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=4CDC3003.5040306@redhat.com \
    --to=lersek@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.