[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1237027249-10512-1-git-send-email-pktoss@gmail.com>
Date: Sat, 14 Mar 2009 12:40:49 +0200
From: Pantelis Koukousoulas <pktoss@...il.com>
To: netdev@...r.kernel.org
Cc: Pantelis Koukousoulas <pktoss@...il.com>
Subject: [PATCH] Make virtio_net report carrier status ON.
The current versions of virtio hardware do not have a way to
turn the link "OFF", so in practice, the status is always ON.
Reporting that via ethtool instead of claiming
"I have no idea", allows NetworkManager to configure the
card automatically as preferred and gives users e.g.,
testing a new livecd in existing qemu/kvm the experience
they expect.
Note that for the next versions of the kernel and virtual
hardware, there is a patch that adds proper link detection
to the driver (since it will now be possible to turn it off).
But even in the light of this, my patch is still valid
because the "default ON" behavior will still be needed for
current qemu / virtio versions that don't support this feature
(VIRTIO_NET_F_STATUS).
Signed-off-by: Pantelis Koukousoulas <pktoss@...il.com>
---
drivers/net/virtio_net.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c688083..e67d16c 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -612,6 +612,7 @@ static struct ethtool_ops virtnet_ethtool_ops = {
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
+ .get_link = ethtool_op_get_link,
};
#define MIN_MTU 68
@@ -739,6 +740,8 @@ static int virtnet_probe(struct virtio_device *vdev)
goto unregister;
}
+ netif_carrier_on(dev);
+
pr_debug("virtnet: registered device %s\n", dev->name);
return 0;
--
1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists