virtio_mmio.c (818b930bc15077fc00ff16bb22c5df1857f05afa) virtio_mmio.c (06ca287dbac9cc19d04ac2901b8c4882c03795ff)
1/*
2 * Virtio memory mapped device driver
3 *
4 * Copyright 2011, ARM Ltd.
5 *
6 * This module allows virtio devices to be used over a virtual, memory mapped
7 * platform device.
8 *

--- 211 unchanged lines hidden (view full) ---

220
221/* the notify function used when creating a virt queue */
222static void vm_notify(struct virtqueue *vq)
223{
224 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
225
226 /* We write the queue's selector into the notification register to
227 * signal the other end */
1/*
2 * Virtio memory mapped device driver
3 *
4 * Copyright 2011, ARM Ltd.
5 *
6 * This module allows virtio devices to be used over a virtual, memory mapped
7 * platform device.
8 *

--- 211 unchanged lines hidden (view full) ---

220
221/* the notify function used when creating a virt queue */
222static void vm_notify(struct virtqueue *vq)
223{
224 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
225
226 /* We write the queue's selector into the notification register to
227 * signal the other end */
228 writel(virtqueue_get_queue_index(vq), vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY);
228 writel(vq->index, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY);
229}
230
231/* Notify all virtqueues on an interrupt. */
232static irqreturn_t vm_interrupt(int irq, void *opaque)
233{
234 struct virtio_mmio_device *vm_dev = opaque;
235 struct virtio_mmio_vq_info *info;
236 struct virtio_driver *vdrv = container_of(vm_dev->vdev.dev.driver,

--- 24 unchanged lines hidden (view full) ---

261
262
263
264static void vm_del_vq(struct virtqueue *vq)
265{
266 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
267 struct virtio_mmio_vq_info *info = vq->priv;
268 unsigned long flags, size;
229}
230
231/* Notify all virtqueues on an interrupt. */
232static irqreturn_t vm_interrupt(int irq, void *opaque)
233{
234 struct virtio_mmio_device *vm_dev = opaque;
235 struct virtio_mmio_vq_info *info;
236 struct virtio_driver *vdrv = container_of(vm_dev->vdev.dev.driver,

--- 24 unchanged lines hidden (view full) ---

261
262
263
264static void vm_del_vq(struct virtqueue *vq)
265{
266 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev);
267 struct virtio_mmio_vq_info *info = vq->priv;
268 unsigned long flags, size;
269 unsigned int index = virtqueue_get_queue_index(vq);
269 unsigned int index = vq->index;
270
271 spin_lock_irqsave(&vm_dev->lock, flags);
272 list_del(&info->node);
273 spin_unlock_irqrestore(&vm_dev->lock, flags);
274
275 vring_del_virtqueue(vq);
276
277 /* Select and deactivate the queue */

--- 380 unchanged lines hidden ---
270
271 spin_lock_irqsave(&vm_dev->lock, flags);
272 list_del(&info->node);
273 spin_unlock_irqrestore(&vm_dev->lock, flags);
274
275 vring_del_virtqueue(vq);
276
277 /* Select and deactivate the queue */

--- 380 unchanged lines hidden ---