diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-13 00:16:35 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-12 08:46:36 -0400 |
commit | 9499f5e7ed5224c40706f0cec6542a9916bc7606 (patch) | |
tree | 3e4e1b36d3d549ea356e88e6e44359a887c6ee01 /include/linux/virtio.h | |
parent | ef688e151c00e5d529703be9a04fd506df8bc54e (diff) |
virtio: add names to virtqueue struct, mapping from devices to queues.
Add a linked list of all virtqueues for a virtio device: this helps for
debugging and is also needed for upcoming interface change.
Also, add a "name" field for clearer debug messages.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r-- | include/linux/virtio.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 9410394bbf96..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; |