WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/netloop: add get_drvinfo() ("etht

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/netloop: add get_drvinfo() ("ethtool -i") support
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Oct 2010 02:35:04 -0700
Delivery-date: Fri, 29 Oct 2010 02:35:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1288344196 -3600
# Node ID f4357b64a3cecb7fea425d7bddbef0c91ab79234
# Parent  7fcbbb8c828503ae31a4a568c68d491dd8e0fe14
xen/netloop: add get_drvinfo() ("ethtool -i") support

Signed-off-by: Laszlo Ersek <lersek@xxxxxxxxxx>
---
 drivers/xen/netback/loopback.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff -r 7fcbbb8c8285 -r f4357b64a3ce drivers/xen/netback/loopback.c
--- a/drivers/xen/netback/loopback.c    Tue Oct 12 11:03:20 2010 +0100
+++ b/drivers/xen/netback/loopback.c    Fri Oct 29 10:23:16 2010 +0100
@@ -62,6 +62,7 @@ struct net_private {
 struct net_private {
        struct net_device *loopback_dev;
        struct net_device_stats stats;
+       int loop_idx;
 };
 
 static int loopback_open(struct net_device *dev)
@@ -181,8 +182,17 @@ static struct net_device_stats *loopback
        return &np->stats;
 }
 
+static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
+{
+       strcpy(info->driver, "netloop");
+       snprintf(info->bus_info, ETHTOOL_BUSINFO_LEN, "vif-0-%d",
+                ((struct net_private *)netdev_priv(dev))->loop_idx);
+}
+
 static struct ethtool_ops network_ethtool_ops =
 {
+       .get_drvinfo = get_drvinfo,
+
        .get_tx_csum = ethtool_op_get_tx_csum,
        .set_tx_csum = ethtool_op_set_tx_csum,
        .get_sg = ethtool_op_get_sg,
@@ -200,11 +210,13 @@ static void loopback_set_multicast_list(
 {
 }
 
-static void loopback_construct(struct net_device *dev, struct net_device *lo)
+static void loopback_construct(struct net_device *dev, struct net_device *lo,
+                              int loop_idx)
 {
        struct net_private *np = netdev_priv(dev);
 
        np->loopback_dev     = lo;
+       np->loop_idx         = loop_idx;
 
        dev->open            = loopback_open;
        dev->stop            = loopback_close;
@@ -250,8 +262,8 @@ static int __init make_loopback(int i)
        if (!dev2)
                goto fail_netdev2;
 
-       loopback_construct(dev1, dev2);
-       loopback_construct(dev2, dev1);
+       loopback_construct(dev1, dev2, i);
+       loopback_construct(dev2, dev1, i);
 
        /*
         * Initialise a dummy MAC address for the 'dummy backend' interface. We

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/netloop: add get_drvinfo() ("ethtool -i") support, Xen patchbot-linux-2.6.18-xen <=