111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/****************************************************************************
211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ****************************************************************************
311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***
411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   This header was automatically generated from a Linux kernel header
511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   of the same name, to make information necessary for userspace to
611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   call into the kernel available to libc.  It contains only constants,
711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   structures, and macros generated from the original header, and thus,
811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   contains no copyrightable information.
911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***
1011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   To edit the content of this header, modify the corresponding
1111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   source file (e.g. under external/kernel-headers/original/) then
1211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   run bionic/libc/kernel/tools/update_all.py
1311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***
1411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   Any manual change here will be lost the next time this script will
1511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***   be run. You've been warned!
1611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ***
1711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ****************************************************************************
1811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert ****************************************************************************/
1911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifndef _LINUX_VHOST_H
2011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define _LINUX_VHOST_H
2111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <linux/types.h>
2211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <linux/compiler.h>
2311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
2411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <linux/ioctl.h>
2511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <linux/virtio_config.h>
2611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <linux/virtio_ring.h>
2711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct vhost_vring_state {
2811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
2911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned int index;
3011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned int num;
3111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
3211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct vhost_vring_file {
3311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
3411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned int index;
3511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert int fd;
3611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
3711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct vhost_vring_addr {
3811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
3911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned int index;
4011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned int flags;
4111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_VRING_F_LOG 0
4211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 desc_user_addr;
4311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
4411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 used_user_addr;
4511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 avail_user_addr;
4611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 log_guest_addr;
4711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
4811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
4911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct vhost_memory_region {
5011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 guest_phys_addr;
5111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 memory_size;
5211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 userspace_addr;
5311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u64 flags_padding;
5511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
5611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_PAGE_SIZE 0x1000
5711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct vhost_memory {
5811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u32 nregions;
6011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert __u32 padding;
6111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert struct vhost_memory_region regions[0];
6211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
6311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_VIRTIO 0xAF
6511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64)
6611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64)
6711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
6811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
7011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
7111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
7211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
7311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state)
7511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr)
7611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
7711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
7811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file)
8011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file)
8111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file)
8211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)
8311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_F_LOG_ALL 26
8511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_NET_F_VIRTIO_NET_HDR 27
8611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SCSI_ABI_VERSION 1
8711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct vhost_scsi_target {
8811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert int abi_version;
9011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert char vhost_wwpn[224];
9111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned short vhost_tpgt;
9211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert unsigned short reserved;
9311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
9511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
9611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
9711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
9811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32)
10011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32)
10111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif
102