diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/lguest/lguest_device.c | 6 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 15 | ||||
-rw-r--r-- | drivers/s390/kvm/kvm_virtio.c | 6 | ||||
-rw-r--r-- | drivers/virtio/virtio_mmio.c | 6 | ||||
-rw-r--r-- | drivers/virtio/virtio_pci.c | 8 |
5 files changed, 41 insertions, 0 deletions
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c index 0dc30ffde5ad..595d73197016 100644 --- a/drivers/lguest/lguest_device.c +++ b/drivers/lguest/lguest_device.c | |||
@@ -381,6 +381,11 @@ error: | |||
381 | return PTR_ERR(vqs[i]); | 381 | return PTR_ERR(vqs[i]); |
382 | } | 382 | } |
383 | 383 | ||
384 | static const char *lg_bus_name(struct virtio_device *vdev) | ||
385 | { | ||
386 | return ""; | ||
387 | } | ||
388 | |||
384 | /* The ops structure which hooks everything together. */ | 389 | /* The ops structure which hooks everything together. */ |
385 | static struct virtio_config_ops lguest_config_ops = { | 390 | static struct virtio_config_ops lguest_config_ops = { |
386 | .get_features = lg_get_features, | 391 | .get_features = lg_get_features, |
@@ -392,6 +397,7 @@ static struct virtio_config_ops lguest_config_ops = { | |||
392 | .reset = lg_reset, | 397 | .reset = lg_reset, |
393 | .find_vqs = lg_find_vqs, | 398 | .find_vqs = lg_find_vqs, |
394 | .del_vqs = lg_del_vqs, | 399 | .del_vqs = lg_del_vqs, |
400 | .bus_name = lg_bus_name, | ||
395 | }; | 401 | }; |
396 | 402 | ||
397 | /* | 403 | /* |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 6ee8410443c4..4dc9d842a7a3 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -39,6 +39,7 @@ module_param(gso, bool, 0444); | |||
39 | #define GOOD_COPY_LEN 128 | 39 | #define GOOD_COPY_LEN 128 |
40 | 40 | ||
41 | #define VIRTNET_SEND_COMMAND_SG_MAX 2 | 41 | #define VIRTNET_SEND_COMMAND_SG_MAX 2 |
42 | #define VIRTNET_DRIVER_VERSION "1.0.0" | ||
42 | 43 | ||
43 | struct virtnet_stats { | 44 | struct virtnet_stats { |
44 | struct u64_stats_sync syncp; | 45 | struct u64_stats_sync syncp; |
@@ -889,7 +890,21 @@ static void virtnet_get_ringparam(struct net_device *dev, | |||
889 | 890 | ||
890 | } | 891 | } |
891 | 892 | ||
893 | |||
894 | static void virtnet_get_drvinfo(struct net_device *dev, | ||
895 | struct ethtool_drvinfo *info) | ||
896 | { | ||
897 | struct virtnet_info *vi = netdev_priv(dev); | ||
898 | struct virtio_device *vdev = vi->vdev; | ||
899 | |||
900 | strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); | ||
901 | strlcpy(info->version, VIRTNET_DRIVER_VERSION, sizeof(info->version)); | ||
902 | strlcpy(info->bus_info, virtio_bus_name(vdev), sizeof(info->bus_info)); | ||
903 | |||
904 | } | ||
905 | |||
892 | static const struct ethtool_ops virtnet_ethtool_ops = { | 906 | static const struct ethtool_ops virtnet_ethtool_ops = { |
907 | .get_drvinfo = virtnet_get_drvinfo, | ||
893 | .get_link = ethtool_op_get_link, | 908 | .get_link = ethtool_op_get_link, |
894 | .get_ringparam = virtnet_get_ringparam, | 909 | .get_ringparam = virtnet_get_ringparam, |
895 | }; | 910 | }; |
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c index 94f49ffa70ba..8af868bab20b 100644 --- a/drivers/s390/kvm/kvm_virtio.c +++ b/drivers/s390/kvm/kvm_virtio.c | |||
@@ -263,6 +263,11 @@ error: | |||
263 | return PTR_ERR(vqs[i]); | 263 | return PTR_ERR(vqs[i]); |
264 | } | 264 | } |
265 | 265 | ||
266 | static const char *kvm_bus_name(struct virtio_device *vdev) | ||
267 | { | ||
268 | return ""; | ||
269 | } | ||
270 | |||
266 | /* | 271 | /* |
267 | * The config ops structure as defined by virtio config | 272 | * The config ops structure as defined by virtio config |
268 | */ | 273 | */ |
@@ -276,6 +281,7 @@ static struct virtio_config_ops kvm_vq_configspace_ops = { | |||
276 | .reset = kvm_reset, | 281 | .reset = kvm_reset, |
277 | .find_vqs = kvm_find_vqs, | 282 | .find_vqs = kvm_find_vqs, |
278 | .del_vqs = kvm_del_vqs, | 283 | .del_vqs = kvm_del_vqs, |
284 | .bus_name = kvm_bus_name, | ||
279 | }; | 285 | }; |
280 | 286 | ||
281 | /* | 287 | /* |
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index acc5e43c373e..2f57380d7ed4 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c | |||
@@ -361,7 +361,12 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, | |||
361 | return 0; | 361 | return 0; |
362 | } | 362 | } |
363 | 363 | ||
364 | static const char *vm_bus_name(struct virtio_device *vdev) | ||
365 | { | ||
366 | struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); | ||
364 | 367 | ||
368 | return vm_dev->pdev->name; | ||
369 | } | ||
365 | 370 | ||
366 | static struct virtio_config_ops virtio_mmio_config_ops = { | 371 | static struct virtio_config_ops virtio_mmio_config_ops = { |
367 | .get = vm_get, | 372 | .get = vm_get, |
@@ -373,6 +378,7 @@ static struct virtio_config_ops virtio_mmio_config_ops = { | |||
373 | .del_vqs = vm_del_vqs, | 378 | .del_vqs = vm_del_vqs, |
374 | .get_features = vm_get_features, | 379 | .get_features = vm_get_features, |
375 | .finalize_features = vm_finalize_features, | 380 | .finalize_features = vm_finalize_features, |
381 | .bus_name = vm_bus_name, | ||
376 | }; | 382 | }; |
377 | 383 | ||
378 | 384 | ||
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 79a31e5b4b68..764ec05ea3e8 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c | |||
@@ -580,6 +580,13 @@ static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, | |||
580 | false, false); | 580 | false, false); |
581 | } | 581 | } |
582 | 582 | ||
583 | static const char *vp_bus_name(struct virtio_device *vdev) | ||
584 | { | ||
585 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); | ||
586 | |||
587 | return pci_name(vp_dev->pci_dev); | ||
588 | } | ||
589 | |||
583 | static struct virtio_config_ops virtio_pci_config_ops = { | 590 | static struct virtio_config_ops virtio_pci_config_ops = { |
584 | .get = vp_get, | 591 | .get = vp_get, |
585 | .set = vp_set, | 592 | .set = vp_set, |
@@ -590,6 +597,7 @@ static struct virtio_config_ops virtio_pci_config_ops = { | |||
590 | .del_vqs = vp_del_vqs, | 597 | .del_vqs = vp_del_vqs, |
591 | .get_features = vp_get_features, | 598 | .get_features = vp_get_features, |
592 | .finalize_features = vp_finalize_features, | 599 | .finalize_features = vp_finalize_features, |
600 | .bus_name = vp_bus_name, | ||
593 | }; | 601 | }; |
594 | 602 | ||
595 | static void virtio_pci_release_dev(struct device *_d) | 603 | static void virtio_pci_release_dev(struct device *_d) |