2 * Copyright (c) 2015 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
15 #ifndef __VIRTIO_VHOST_STD_H__
16 #define __VIRTIO_VHOST_STD_H__
24 } vhost_memory_region_t;
30 vhost_memory_region_t regions[0];
37 } vhost_vring_state_t;
61 /* vhost kernel ioctls */
62 #define VHOST_VIRTIO 0xAF
63 #define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, u64)
64 #define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, u64)
65 #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
66 #define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
67 #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, vhost_memory_t)
68 #define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, u64)
69 #define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
70 #define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, vhost_vring_state_t)
71 #define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, vhost_vring_addr_t)
72 #define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, vhost_vring_state_t)
73 #define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, vhost_vring_state_t)
74 #define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, vhost_vring_file_t)
75 #define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, vhost_vring_file_t)
76 #define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, vhost_vring_file_t)
77 #define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, vhost_vring_file_t)
82 * fd.io coding-style-patch-verification: ON
85 * eval: (c-set-style "gnu")