• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #![allow(non_upper_case_globals)]
6 #![allow(non_camel_case_types)]
7 #![allow(non_snake_case)]
8 
9 use base::{ioctl_io_nr, ioctl_ior_nr, ioctl_iow_nr, ioctl_iowr_nr};
10 
11 // generated with bindgen /usr/include/linux/vhost.h --no-unstable-rust --constified-enum '*' --with-derive-default
12 pub mod vhost;
13 // generated with bindgen /usr/include/linux/virtio_net.h --no-unstable-rust --constified-enum '*' --with-derive-default
14 pub mod virtio_net;
15 // generated with bindgen /usr/include/linux/virtio_ring.h --no-unstable-rust --constified-enum '*' --with-derive-default
16 pub mod virtio_ring;
17 pub use crate::vhost::*;
18 pub use crate::virtio_net::*;
19 pub use crate::virtio_ring::*;
20 
21 pub const VHOST: ::std::os::raw::c_uint = 0xaf;
22 
23 ioctl_ior_nr!(VHOST_GET_FEATURES, VHOST, 0x00, ::std::os::raw::c_ulonglong);
24 ioctl_iow_nr!(VHOST_SET_FEATURES, VHOST, 0x00, ::std::os::raw::c_ulonglong);
25 ioctl_io_nr!(VHOST_SET_OWNER, VHOST, 0x01);
26 ioctl_io_nr!(VHOST_RESET_OWNER, VHOST, 0x02);
27 ioctl_iow_nr!(VHOST_SET_MEM_TABLE, VHOST, 0x03, vhost_memory);
28 ioctl_iow_nr!(VHOST_SET_LOG_BASE, VHOST, 0x04, ::std::os::raw::c_ulonglong);
29 ioctl_iow_nr!(VHOST_SET_LOG_FD, VHOST, 0x07, ::std::os::raw::c_int);
30 ioctl_iow_nr!(VHOST_SET_VRING_NUM, VHOST, 0x10, vhost_vring_state);
31 ioctl_iow_nr!(VHOST_SET_VRING_ADDR, VHOST, 0x11, vhost_vring_addr);
32 ioctl_iow_nr!(VHOST_SET_VRING_BASE, VHOST, 0x12, vhost_vring_state);
33 ioctl_iowr_nr!(VHOST_GET_VRING_BASE, VHOST, 0x12, vhost_vring_state);
34 ioctl_iow_nr!(VHOST_SET_VRING_KICK, VHOST, 0x20, vhost_vring_file);
35 ioctl_iow_nr!(VHOST_SET_VRING_CALL, VHOST, 0x21, vhost_vring_file);
36 ioctl_iow_nr!(VHOST_SET_VRING_ERR, VHOST, 0x22, vhost_vring_file);
37 ioctl_iow_nr!(VHOST_NET_SET_BACKEND, VHOST, 0x30, vhost_vring_file);
38 ioctl_iow_nr!(VHOST_SCSI_SET_ENDPOINT, VHOST, 0x40, vhost_scsi_target);
39 ioctl_iow_nr!(VHOST_SCSI_CLEAR_ENDPOINT, VHOST, 0x41, vhost_scsi_target);
40 ioctl_iow_nr!(
41     VHOST_SCSI_GET_ABI_VERSION,
42     VHOST,
43     0x42,
44     ::std::os::raw::c_int
45 );
46 ioctl_iow_nr!(
47     VHOST_SCSI_SET_EVENTS_MISSED,
48     VHOST,
49     0x43,
50     ::std::os::raw::c_uint
51 );
52 ioctl_iow_nr!(
53     VHOST_SCSI_GET_EVENTS_MISSED,
54     VHOST,
55     0x44,
56     ::std::os::raw::c_uint
57 );
58 ioctl_iow_nr!(
59     VHOST_VSOCK_SET_GUEST_CID,
60     VHOST,
61     0x60,
62     ::std::os::raw::c_ulonglong
63 );
64 ioctl_iow_nr!(VHOST_VSOCK_SET_RUNNING, VHOST, 0x61, ::std::os::raw::c_int);
65