linux/drivers/vdpa/vdpa_sim/vdpa_sim.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2020, Red Hat Inc. All rights reserved.
 */

#ifndef _VDPA_SIM_H
#define _VDPA_SIM_H

#include <linux/iova.h>
#include <linux/vringh.h>
#include <linux/vdpa.h>
#include <linux/virtio_byteorder.h>
#include <linux/vhost_iotlb.h>
#include <uapi/linux/virtio_config.h>

#define VDPASIM_FEATURES

struct vdpasim;

struct vdpasim_virtqueue {};

struct vdpasim_dev_attr {};

/* State of each vdpasim device */
struct vdpasim {};

struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *attr,
			       const struct vdpa_dev_set_config *config);
void vdpasim_schedule_work(struct vdpasim *vdpasim);

/* TODO: cross-endian support */
static inline bool vdpasim_is_little_endian(struct vdpasim *vdpasim)
{}

static inline u16 vdpasim16_to_cpu(struct vdpasim *vdpasim, __virtio16 val)
{}

static inline __virtio16 cpu_to_vdpasim16(struct vdpasim *vdpasim, u16 val)
{}

static inline u32 vdpasim32_to_cpu(struct vdpasim *vdpasim, __virtio32 val)
{}

static inline __virtio32 cpu_to_vdpasim32(struct vdpasim *vdpasim, u32 val)
{}

static inline u64 vdpasim64_to_cpu(struct vdpasim *vdpasim, __virtio64 val)
{}

static inline __virtio64 cpu_to_vdpasim64(struct vdpasim *vdpasim, u64 val)
{}

#endif