|
@@ -100,6 +100,10 @@
|
|
* vdev: the virtio_device
|
|
* vdev: the virtio_device
|
|
* This gives the final feature bits for the device: it can change
|
|
* This gives the final feature bits for the device: it can change
|
|
* the dev->feature bits if it wants.
|
|
* the dev->feature bits if it wants.
|
|
|
|
+ * @bus_name: return the bus name associated with the device
|
|
|
|
+ * vdev: the virtio_device
|
|
|
|
+ * This returns a pointer to the bus name a la pci_name from which
|
|
|
|
+ * the caller can then copy.
|
|
*/
|
|
*/
|
|
typedef void vq_callback_t(struct virtqueue *);
|
|
typedef void vq_callback_t(struct virtqueue *);
|
|
struct virtio_config_ops {
|
|
struct virtio_config_ops {
|
|
@@ -117,6 +121,7 @@ struct virtio_config_ops {
|
|
void (*del_vqs)(struct virtio_device *);
|
|
void (*del_vqs)(struct virtio_device *);
|
|
u32 (*get_features)(struct virtio_device *vdev);
|
|
u32 (*get_features)(struct virtio_device *vdev);
|
|
void (*finalize_features)(struct virtio_device *vdev);
|
|
void (*finalize_features)(struct virtio_device *vdev);
|
|
|
|
+ const char *(*bus_name)(struct virtio_device *vdev);
|
|
};
|
|
};
|
|
|
|
|
|
/* If driver didn't advertise the feature, it will never appear. */
|
|
/* 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,
|
|
return ERR_PTR(err);
|
|
return ERR_PTR(err);
|
|
return vq;
|
|
return vq;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+static inline
|
|
|
|
+const char *virtio_bus_name(struct virtio_device *vdev)
|
|
|
|
+{
|
|
|
|
+ if (!vdev->config->bus_name)
|
|
|
|
+ return "virtio";
|
|
|
|
+ return vdev->config->bus_name(vdev);
|
|
|
|
+}
|
|
|
|
+
|
|
#endif /* __KERNEL__ */
|
|
#endif /* __KERNEL__ */
|
|
#endif /* _LINUX_VIRTIO_CONFIG_H */
|
|
#endif /* _LINUX_VIRTIO_CONFIG_H */
|