* [PATCH] Make virtio_net report carrier status ON.
@ 2009-03-14 10:40 Pantelis Koukousoulas
0 siblings, 0 replies; only message in thread
From: Pantelis Koukousoulas @ 2009-03-14 10:40 UTC (permalink / raw)
To: netdev; +Cc: Pantelis Koukousoulas
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@gmail.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-14 10:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-14 10:40 [PATCH] Make virtio_net report carrier status ON Pantelis Koukousoulas
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).