diff options
Diffstat (limited to 'include/linux/virtio_config.h')
-rw-r--r-- | include/linux/virtio_config.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index add4790b21fe..63f98d0a8efa 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -100,6 +100,10 @@ | |||
100 | * vdev: the virtio_device | 100 | * vdev: the virtio_device |
101 | * This gives the final feature bits for the device: it can change | 101 | * This gives the final feature bits for the device: it can change |
102 | * the dev->feature bits if it wants. | 102 | * the dev->feature bits if it wants. |
103 | * @bus_name: return the bus name associated with the device | ||
104 | * vdev: the virtio_device | ||
105 | * This returns a pointer to the bus name a la pci_name from which | ||
106 | * the caller can then copy. | ||
103 | */ | 107 | */ |
104 | typedef void vq_callback_t(struct virtqueue *); | 108 | typedef void vq_callback_t(struct virtqueue *); |
105 | struct virtio_config_ops { | 109 | struct virtio_config_ops { |
@@ -117,6 +121,7 @@ struct virtio_config_ops { | |||
117 | void (*del_vqs)(struct virtio_device *); | 121 | void (*del_vqs)(struct virtio_device *); |
118 | u32 (*get_features)(struct virtio_device *vdev); | 122 | u32 (*get_features)(struct virtio_device *vdev); |
119 | void (*finalize_features)(struct virtio_device *vdev); | 123 | void (*finalize_features)(struct virtio_device *vdev); |
124 | const char *(*bus_name)(struct virtio_device *vdev); | ||
120 | }; | 125 | }; |
121 | 126 | ||
122 | /* If driver didn't advertise the feature, it will never appear. */ | 127 | /* If driver didn't advertise the feature, it will never appear. */ |
@@ -182,5 +187,14 @@ struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev, | |||
182 | return ERR_PTR(err); | 187 | return ERR_PTR(err); |
183 | return vq; | 188 | return vq; |
184 | } | 189 | } |
190 | |||
191 | static inline | ||
192 | const char *virtio_bus_name(struct virtio_device *vdev) | ||
193 | { | ||
194 | if (!vdev->config->bus_name) | ||
195 | return "virtio"; | ||
196 | return vdev->config->bus_name(vdev); | ||
197 | } | ||
198 | |||
185 | #endif /* __KERNEL__ */ | 199 | #endif /* __KERNEL__ */ |
186 | #endif /* _LINUX_VIRTIO_CONFIG_H */ | 200 | #endif /* _LINUX_VIRTIO_CONFIG_H */ |