aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-23 11:07:47 -0400
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 05:05:26 -0500
commitb3bb62d11950eb6ac87403cacd667f84fa9495bc (patch)
treef3aee72f5e622722d19c484c7f5925990e97cffb /include/linux
parentc102659d690d382171bd2e40f35c5c811f0cdcac (diff)
virtio: add legacy feature table support
virtio-blk has some legacy feature bits that modern drivers must not negotiate, but are needed for old legacy hosts (that e.g. don't support virtio-scsi). Allow a separate legacy feature table for such cases. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/virtio.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index d6359a5d5d4e..f70411eb9d27 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -130,6 +130,8 @@ int virtio_device_restore(struct virtio_device *dev);
130 * @id_table: the ids serviced by this driver. 130 * @id_table: the ids serviced by this driver.
131 * @feature_table: an array of feature numbers supported by this driver. 131 * @feature_table: an array of feature numbers supported by this driver.
132 * @feature_table_size: number of entries in the feature table array. 132 * @feature_table_size: number of entries in the feature table array.
133 * @feature_table_legacy: same as feature_table but when working in legacy mode.
134 * @feature_table_size_legacy: number of entries in feature table legacy array.
133 * @probe: the function to call when a device is found. Returns 0 or -errno. 135 * @probe: the function to call when a device is found. Returns 0 or -errno.
134 * @remove: the function to call when a device is removed. 136 * @remove: the function to call when a device is removed.
135 * @config_changed: optional function to call when the device configuration 137 * @config_changed: optional function to call when the device configuration
@@ -140,6 +142,8 @@ struct virtio_driver {
140 const struct virtio_device_id *id_table; 142 const struct virtio_device_id *id_table;
141 const unsigned int *feature_table; 143 const unsigned int *feature_table;
142 unsigned int feature_table_size; 144 unsigned int feature_table_size;
145 const unsigned int *feature_table_legacy;
146 unsigned int feature_table_size_legacy;
143 int (*probe)(struct virtio_device *dev); 147 int (*probe)(struct virtio_device *dev);
144 void (*scan)(struct virtio_device *dev); 148 void (*scan)(struct virtio_device *dev);
145 void (*remove)(struct virtio_device *dev); 149 void (*remove)(struct virtio_device *dev);