···4949 * transport being used (eg. virtio_ring), the rest are per-device feature
5050 * bits. */
5151#define VIRTIO_TRANSPORT_F_START 28
5252-#define VIRTIO_TRANSPORT_F_END 33
5252+#define VIRTIO_TRANSPORT_F_END 34
53535454#ifndef VIRTIO_CONFIG_NO_LEGACY
5555/* Do we get callbacks when the ring is completely used, even if we've
···6363/* v1.0 compliant. */
6464#define VIRTIO_F_VERSION_1 32
65656666+/*
6767+ * If clear - device has the IOMMU bypass quirk feature.
6868+ * If set - use platform tools to detect the IOMMU.
6969+ *
7070+ * Note the reverse polarity (compared to most other features),
7171+ * this is for compatibility with legacy systems.
7272+ */
7373+#define VIRTIO_F_IOMMU_PLATFORM 33
6674#endif /* _LINUX_VIRTIO_CONFIG_H */
···3535#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
3636#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
3737#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Dynamic offload configuration. */
3838+#define VIRTIO_NET_F_MTU 3 /* Initial MTU advice */
3839#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
3940#define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */
4041#define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */
···7374 * Legal values are between 1 and 0x8000
7475 */
7576 uint16_t max_virtqueue_pairs;
7777+ /* Default maximum transmit unit advice */
7878+ uint16_t mtu;
7679} QEMU_PACKED;
77807881/*
+94
include/standard-headers/linux/virtio_vsock.h
···11+/*
22+ * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
33+ * anyone can use the definitions to implement compatible drivers/servers:
44+ *
55+ *
66+ * Redistribution and use in source and binary forms, with or without
77+ * modification, are permitted provided that the following conditions
88+ * are met:
99+ * 1. Redistributions of source code must retain the above copyright
1010+ * notice, this list of conditions and the following disclaimer.
1111+ * 2. Redistributions in binary form must reproduce the above copyright
1212+ * notice, this list of conditions and the following disclaimer in the
1313+ * documentation and/or other materials provided with the distribution.
1414+ * 3. Neither the name of IBM nor the names of its contributors
1515+ * may be used to endorse or promote products derived from this software
1616+ * without specific prior written permission.
1717+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
1818+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1919+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2020+ * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
2121+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2222+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2323+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2424+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2525+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2626+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727+ * SUCH DAMAGE.
2828+ *
2929+ * Copyright (C) Red Hat, Inc., 2013-2015
3030+ * Copyright (C) Asias He <asias@redhat.com>, 2013
3131+ * Copyright (C) Stefan Hajnoczi <stefanha@redhat.com>, 2015
3232+ */
3333+3434+#ifndef _LINUX_VIRTIO_VSOCK_H
3535+#define _LINUX_VIRTIO_VSOCK_H
3636+3737+#include "standard-headers/linux/types.h"
3838+#include "standard-headers/linux/virtio_ids.h"
3939+#include "standard-headers/linux/virtio_config.h"
4040+4141+struct virtio_vsock_config {
4242+ uint64_t guest_cid;
4343+} QEMU_PACKED;
4444+4545+enum virtio_vsock_event_id {
4646+ VIRTIO_VSOCK_EVENT_TRANSPORT_RESET = 0,
4747+};
4848+4949+struct virtio_vsock_event {
5050+ uint32_t id;
5151+} QEMU_PACKED;
5252+5353+struct virtio_vsock_hdr {
5454+ uint64_t src_cid;
5555+ uint64_t dst_cid;
5656+ uint32_t src_port;
5757+ uint32_t dst_port;
5858+ uint32_t len;
5959+ uint16_t type; /* enum virtio_vsock_type */
6060+ uint16_t op; /* enum virtio_vsock_op */
6161+ uint32_t flags;
6262+ uint32_t buf_alloc;
6363+ uint32_t fwd_cnt;
6464+} QEMU_PACKED;
6565+6666+enum virtio_vsock_type {
6767+ VIRTIO_VSOCK_TYPE_STREAM = 1,
6868+};
6969+7070+enum virtio_vsock_op {
7171+ VIRTIO_VSOCK_OP_INVALID = 0,
7272+7373+ /* Connect operations */
7474+ VIRTIO_VSOCK_OP_REQUEST = 1,
7575+ VIRTIO_VSOCK_OP_RESPONSE = 2,
7676+ VIRTIO_VSOCK_OP_RST = 3,
7777+ VIRTIO_VSOCK_OP_SHUTDOWN = 4,
7878+7979+ /* To send payload */
8080+ VIRTIO_VSOCK_OP_RW = 5,
8181+8282+ /* Tell the peer our credit info */
8383+ VIRTIO_VSOCK_OP_CREDIT_UPDATE = 6,
8484+ /* Request the peer to send the credit info to us */
8585+ VIRTIO_VSOCK_OP_CREDIT_REQUEST = 7,
8686+};
8787+8888+/* VIRTIO_VSOCK_OP_SHUTDOWN flags values */
8989+enum virtio_vsock_shutdown {
9090+ VIRTIO_VSOCK_SHUTDOWN_RCV = 1,
9191+ VIRTIO_VSOCK_SHUTDOWN_SEND = 2,
9292+};
9393+9494+#endif /* _LINUX_VIRTIO_VSOCK_H */