blob: efef2b1d951fb104540266ea51935b3960f2cb31 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _DRIVERS_VIRTIO_VIRTIO_MAGMA_H
#define _DRIVERS_VIRTIO_VIRTIO_MAGMA_H
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/virtio.h>
#include <linux/virtmagma.h>
#define VIRTMAGMA_VQ_IN 0
#define VIRTMAGMA_VQ_OUT 1
#define VIRTMAGMA_QUEUE_COUNT 2
struct virtmagma_info {
bool enabled;
int (*virtio_probe)(struct virtmagma_info* vi, struct virtio_device *vdev);
void (*virtio_remove)(struct virtmagma_info* vi, struct virtio_device *vdev);
long (*ioctl)(struct virtmagma_info* vi, unsigned int cmd, void __user *ptr);
void (*virtio_find_vqs_prepare)(struct virtmagma_info* vi, vq_callback_t **vq_callbacks, const char **vq_names);
void (*virtio_find_vqs_complete)(struct virtmagma_info* vi, struct virtqueue **vqs);
int (*virtio_device_ready_prepare)(struct virtmagma_info* vi);
void (*virtio_device_ready_complete)(struct virtmagma_info* vi);
uint32_t queue_count;
void *private;
};
int virtmagma_init(struct virtmagma_info *vi);
extern const size_t magma_info_offset;
#endif /* _DRIVERS_VIRTIO_VIRTIO_MAGMA_H */