@@ -136,4 +136,7 @@ struct virtio_driver {
int register_virtio_driver(struct virtio_driver *drv);
void unregister_virtio_driver(struct virtio_driver *drv);
+
+/* return the internal queue index associated with the virtqueue */
+extern int virtio_get_queue_index(struct virtqueue *vq);
#endif /* _LINUX_VIRTIO_H */
@@ -359,6 +359,15 @@ static int vp_request_intx(struct virtio
return err;
}
+/* Return the internal queue index associated with the virtqueue */
+int virtio_get_queue_index(struct virtqueue *vq)
+{
+ struct virtio_pci_vq_info *info = vq->priv;
+
+ return info->queue_index;
+}
+EXPORT_SYMBOL(virtio_get_queue_index);
+
static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
void (*callback)(struct virtqueue *vq),
const char *name,