aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-02-04 23:49:57 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-02-04 07:49:58 -0500
commit18445c4d501b9ab4336f66ef46b092661ddaf336 (patch)
tree9d23185f207d912942890cf047d1d3200806b401 /include/linux/virtio.h
parenta586d4f6016f7139d8c26df0e6927131168d3b5b (diff)
virtio: explicit enable_cb/disable_cb rather than callback return.
It seems that virtio_net wants to disable callbacks (interrupts) before calling netif_rx_schedule(), so we can't use the return value to do so. Rename "restart" to "cb_enable" and introduce "cb_disable" hook: callback now returns void, rather than a boolean. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r--include/linux/virtio.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 14e1379876d3..951d81747b42 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -11,15 +11,13 @@
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 * @callback: the function to call when buffers are consumed (can be NULL). 13 * @callback: the function to call when buffers are consumed (can be NULL).
14 * If this returns false, callbacks are suppressed until vq_ops->restart
15 * is called.
16 * @vdev: the virtio device this queue was created for. 14 * @vdev: the virtio device this queue was created for.
17 * @vq_ops: the operations for this virtqueue (see below). 15 * @vq_ops: the operations for this virtqueue (see below).
18 * @priv: a pointer for the virtqueue implementation to use. 16 * @priv: a pointer for the virtqueue implementation to use.
19 */ 17 */
20struct virtqueue 18struct virtqueue
21{ 19{
22 bool (*callback)(struct virtqueue *vq); 20 void (*callback)(struct virtqueue *vq);
23 struct virtio_device *vdev; 21 struct virtio_device *vdev;
24 struct virtqueue_ops *vq_ops; 22 struct virtqueue_ops *vq_ops;
25 void *priv; 23 void *priv;
@@ -41,7 +39,9 @@ struct virtqueue
41 * vq: the struct virtqueue we're talking about. 39 * vq: the struct virtqueue we're talking about.
42 * len: the length written into the buffer 40 * len: the length written into the buffer
43 * Returns NULL or the "data" token handed to add_buf. 41 * Returns NULL or the "data" token handed to add_buf.
44 * @restart: restart callbacks after callback returned false. 42 * @disable_cb: disable callbacks
43 * vq: the struct virtqueue we're talking about.
44 * @enable_cb: restart callbacks after disable_cb.
45 * vq: the struct virtqueue we're talking about. 45 * vq: the struct virtqueue we're talking about.
46 * This returns "false" (and doesn't re-enable) if there are pending 46 * This returns "false" (and doesn't re-enable) if there are pending
47 * buffers in the queue, to avoid a race. 47 * buffers in the queue, to avoid a race.
@@ -65,7 +65,8 @@ struct virtqueue_ops {
65 65
66 void *(*get_buf)(struct virtqueue *vq, unsigned int *len); 66 void *(*get_buf)(struct virtqueue *vq, unsigned int *len);
67 67
68 bool (*restart)(struct virtqueue *vq); 68 void (*disable_cb)(struct virtqueue *vq);
69 bool (*enable_cb)(struct virtqueue *vq);
69 70
70 void (*shutdown)(struct virtqueue *vq); 71 void (*shutdown)(struct virtqueue *vq);
71}; 72};