diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index bb6b67f6b0cc..b6d402806ae6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
986 | goto unregister; | 986 | goto unregister; |
987 | } | 987 | } |
988 | 988 | ||
989 | vi->status = VIRTIO_NET_S_LINK_UP; | 989 | /* Assume link up if device can't report link status, |
990 | virtnet_update_status(vi); | 990 | otherwise get link status from config. */ |
991 | netif_carrier_on(dev); | 991 | if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) { |
992 | netif_carrier_off(dev); | ||
993 | virtnet_update_status(vi); | ||
994 | } else { | ||
995 | vi->status = VIRTIO_NET_S_LINK_UP; | ||
996 | netif_carrier_on(dev); | ||
997 | } | ||
992 | 998 | ||
993 | pr_debug("virtnet: registered device %s\n", dev->name); | 999 | pr_debug("virtnet: registered device %s\n", dev->name); |
994 | return 0; | 1000 | return 0; |