aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-11-14 09:17:08 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-16 17:26:46 -0500
commit66846048f55c6c05a4c46c2daabb773173f8f28d (patch)
tree21fdef9bb249056f7f334e67fbbc05a61b0cf9ce /drivers/virtio
parent64882709ef07f3eae29c7afc5aa8b84d12733a72 (diff)
enable virtio_net to return bus_info in ethtool -i consistent with emulated NICs
Add a new .bus_name to virtio_config_ops then modify virtio_net to call through to it in an ethtool .get_drvinfo routine to report bus_info in ethtool -i output which is consistent with other emulated NICs and the output of lspci. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_mmio.c6
-rw-r--r--drivers/virtio/virtio_pci.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index acc5e43c373..2f57380d7ed 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
364static 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
366static struct virtio_config_ops virtio_mmio_config_ops = { 371static 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 79a31e5b4b6..764ec05ea3e 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
583static 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
583static struct virtio_config_ops virtio_pci_config_ops = { 590static 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
595static void virtio_pci_release_dev(struct device *_d) 603static void virtio_pci_release_dev(struct device *_d)