mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
dbe449d8f8
Fix virtio test compilation failure caused by vq reset. ../../drivers/virtio/virtio_ring.c: In function ‘vring_create_virtqueue_packed’: ../../drivers/virtio/virtio_ring.c:1999:8: error: ‘struct virtqueue’ has no member named ‘reset’ 1999 | vq->vq.reset = false; | ^ ../../drivers/virtio/virtio_ring.c: In function ‘__vring_new_virtqueue’: ../../drivers/virtio/virtio_ring.c:2493:8: error: ‘struct virtqueue’ has no member named ‘reset’ 2493 | vq->vq.reset = false; | ^ ../../drivers/virtio/virtio_ring.c: In function ‘virtqueue_resize’: ../../drivers/virtio/virtio_ring.c:2587:18: error: ‘struct virtqueue’ has no member named ‘num_max’ 2587 | if (num > vq->vq.num_max) | ^ ../../drivers/virtio/virtio_ring.c:2596:11: error: ‘struct virtio_device’ has no member named ‘config’ 2596 | if (!vdev->config->disable_vq_and_reset) | ^~ ../../drivers/virtio/virtio_ring.c:2599:11: error: ‘struct virtio_device’ has no member named ‘config’ 2599 | if (!vdev->config->enable_vq_after_reset) | ^~ ../../drivers/virtio/virtio_ring.c:2602:12: error: ‘struct virtio_device’ has no member named ‘config’ 2602 | err = vdev->config->disable_vq_and_reset(_vq); | ^~ ../../drivers/virtio/virtio_ring.c:2614:10: error: ‘struct virtio_device’ has no member named ‘config’ 2614 | if (vdev->config->enable_vq_after_reset(_vq)) | ^~ make: *** [<builtin>: virtio_ring.o] Error 1 Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Message-Id: <20220830110549.103168-1-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
73 lines
1.8 KiB
C
73 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef LINUX_VIRTIO_H
|
|
#define LINUX_VIRTIO_H
|
|
#include <linux/scatterlist.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/spinlock.h>
|
|
|
|
struct device {
|
|
void *parent;
|
|
};
|
|
|
|
struct virtio_device {
|
|
struct device dev;
|
|
u64 features;
|
|
struct list_head vqs;
|
|
spinlock_t vqs_list_lock;
|
|
const struct virtio_config_ops *config;
|
|
};
|
|
|
|
struct virtqueue {
|
|
struct list_head list;
|
|
void (*callback)(struct virtqueue *vq);
|
|
const char *name;
|
|
struct virtio_device *vdev;
|
|
unsigned int index;
|
|
unsigned int num_free;
|
|
unsigned int num_max;
|
|
void *priv;
|
|
bool reset;
|
|
};
|
|
|
|
/* Interfaces exported by virtio_ring. */
|
|
int virtqueue_add_sgs(struct virtqueue *vq,
|
|
struct scatterlist *sgs[],
|
|
unsigned int out_sgs,
|
|
unsigned int in_sgs,
|
|
void *data,
|
|
gfp_t gfp);
|
|
|
|
int virtqueue_add_outbuf(struct virtqueue *vq,
|
|
struct scatterlist sg[], unsigned int num,
|
|
void *data,
|
|
gfp_t gfp);
|
|
|
|
int virtqueue_add_inbuf(struct virtqueue *vq,
|
|
struct scatterlist sg[], unsigned int num,
|
|
void *data,
|
|
gfp_t gfp);
|
|
|
|
bool virtqueue_kick(struct virtqueue *vq);
|
|
|
|
void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len);
|
|
|
|
void virtqueue_disable_cb(struct virtqueue *vq);
|
|
|
|
bool virtqueue_enable_cb(struct virtqueue *vq);
|
|
bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
|
|
|
|
void *virtqueue_detach_unused_buf(struct virtqueue *vq);
|
|
struct virtqueue *vring_new_virtqueue(unsigned int index,
|
|
unsigned int num,
|
|
unsigned int vring_align,
|
|
struct virtio_device *vdev,
|
|
bool weak_barriers,
|
|
bool ctx,
|
|
void *pages,
|
|
bool (*notify)(struct virtqueue *vq),
|
|
void (*callback)(struct virtqueue *vq),
|
|
const char *name);
|
|
void vring_del_virtqueue(struct virtqueue *vq);
|
|
|
|
#endif
|