diff options
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r-- | include/linux/virtio.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 06005fa9e982..4fca4f5440ba 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -10,14 +10,17 @@ | |||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * virtqueue - a queue to register buffers for sending or receiving. | 12 | * virtqueue - a queue to register buffers for sending or receiving. |
13 | * @list: the chain of virtqueues for this device | ||
13 | * @callback: the function to call when buffers are consumed (can be NULL). | 14 | * @callback: the function to call when buffers are consumed (can be NULL). |
15 | * @name: the name of this virtqueue (mainly for debugging) | ||
14 | * @vdev: the virtio device this queue was created for. | 16 | * @vdev: the virtio device this queue was created for. |
15 | * @vq_ops: the operations for this virtqueue (see below). | 17 | * @vq_ops: the operations for this virtqueue (see below). |
16 | * @priv: a pointer for the virtqueue implementation to use. | 18 | * @priv: a pointer for the virtqueue implementation to use. |
17 | */ | 19 | */ |
18 | struct virtqueue | 20 | struct virtqueue { |
19 | { | 21 | struct list_head list; |
20 | void (*callback)(struct virtqueue *vq); | 22 | void (*callback)(struct virtqueue *vq); |
23 | const char *name; | ||
21 | struct virtio_device *vdev; | 24 | struct virtio_device *vdev; |
22 | struct virtqueue_ops *vq_ops; | 25 | struct virtqueue_ops *vq_ops; |
23 | void *priv; | 26 | void *priv; |
@@ -76,15 +79,16 @@ struct virtqueue_ops { | |||
76 | * @dev: underlying device. | 79 | * @dev: underlying device. |
77 | * @id: the device type identification (used to match it with a driver). | 80 | * @id: the device type identification (used to match it with a driver). |
78 | * @config: the configuration ops for this device. | 81 | * @config: the configuration ops for this device. |
82 | * @vqs: the list of virtqueues for this device. | ||
79 | * @features: the features supported by both driver and device. | 83 | * @features: the features supported by both driver and device. |
80 | * @priv: private pointer for the driver's use. | 84 | * @priv: private pointer for the driver's use. |
81 | */ | 85 | */ |
82 | struct virtio_device | 86 | struct virtio_device { |
83 | { | ||
84 | int index; | 87 | int index; |
85 | struct device dev; | 88 | struct device dev; |
86 | struct virtio_device_id id; | 89 | struct virtio_device_id id; |
87 | struct virtio_config_ops *config; | 90 | struct virtio_config_ops *config; |
91 | struct list_head vqs; | ||
88 | /* Note that this is a Linux set_bit-style bitmap. */ | 92 | /* Note that this is a Linux set_bit-style bitmap. */ |
89 | unsigned long features[1]; | 93 | unsigned long features[1]; |
90 | void *priv; | 94 | void *priv; |
@@ -99,8 +103,7 @@ void unregister_virtio_device(struct virtio_device *dev); | |||
99 | * @id_table: the ids serviced by this driver. | 103 | * @id_table: the ids serviced by this driver. |
100 | * @feature_table: an array of feature numbers supported by this device. | 104 | * @feature_table: an array of feature numbers supported by this device. |
101 | * @feature_table_size: number of entries in the feature table array. | 105 | * @feature_table_size: number of entries in the feature table array. |
102 | * @probe: the function to call when a device is found. Returns a token for | 106 | * @probe: the function to call when a device is found. Returns 0 or -errno. |
103 | * remove, or PTR_ERR(). | ||
104 | * @remove: the function when a device is removed. | 107 | * @remove: the function when a device is removed. |
105 | * @config_changed: optional function to call when the device configuration | 108 | * @config_changed: optional function to call when the device configuration |
106 | * changes; may be called in interrupt context. | 109 | * changes; may be called in interrupt context. |