blob: 8b2429ca1d8912a60377b9943b5f01d0b179b563 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
Christopher Ferris49f525c2016-12-12 14:55:36 -080019#ifndef _UAPI_LINUX_VIRTIO_NET_H
20#define _UAPI_LINUX_VIRTIO_NET_H
Ben Cheng655a7c02013-10-16 16:09:24 -070021#include <linux/types.h>
22#include <linux/virtio_ids.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <linux/virtio_config.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080025#include <linux/virtio_types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070026#include <linux/if_ether.h>
27#define VIRTIO_NET_F_CSUM 0
Christopher Ferris05d08e92016-02-04 13:16:38 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define VIRTIO_NET_F_GUEST_CSUM 1
Christopher Ferris05d08e92016-02-04 13:16:38 -080030#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2
Christopher Ferris49f525c2016-12-12 14:55:36 -080031#define VIRTIO_NET_F_MTU 3
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define VIRTIO_NET_F_MAC 5
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080034#define VIRTIO_NET_F_GUEST_TSO4 7
Christopher Ferris05d08e92016-02-04 13:16:38 -080035#define VIRTIO_NET_F_GUEST_TSO6 8
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define VIRTIO_NET_F_GUEST_ECN 9
37#define VIRTIO_NET_F_GUEST_UFO 10
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080039#define VIRTIO_NET_F_HOST_TSO4 11
Christopher Ferris05d08e92016-02-04 13:16:38 -080040#define VIRTIO_NET_F_HOST_TSO6 12
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define VIRTIO_NET_F_HOST_ECN 13
42#define VIRTIO_NET_F_HOST_UFO 14
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080044#define VIRTIO_NET_F_MRG_RXBUF 15
Christopher Ferris05d08e92016-02-04 13:16:38 -080045#define VIRTIO_NET_F_STATUS 16
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define VIRTIO_NET_F_CTRL_VQ 17
47#define VIRTIO_NET_F_CTRL_RX 18
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080049#define VIRTIO_NET_F_CTRL_VLAN 19
Christopher Ferris05d08e92016-02-04 13:16:38 -080050#define VIRTIO_NET_F_CTRL_RX_EXTRA 20
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define VIRTIO_NET_F_GUEST_ANNOUNCE 21
52#define VIRTIO_NET_F_MQ 22
Christopher Ferris05d08e92016-02-04 13:16:38 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080054#define VIRTIO_NET_F_CTRL_MAC_ADDR 23
Christopher Ferris05d08e92016-02-04 13:16:38 -080055#ifndef VIRTIO_NET_NO_LEGACY
56#define VIRTIO_NET_F_GSO 6
57#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080059#define VIRTIO_NET_S_LINK_UP 1
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define VIRTIO_NET_S_ANNOUNCE 2
61struct virtio_net_config {
Tao Baod7db5942015-01-28 10:07:51 -080062 __u8 mac[ETH_ALEN];
Ben Cheng655a7c02013-10-16 16:09:24 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -080064 __u16 status;
Tao Baod7db5942015-01-28 10:07:51 -080065 __u16 max_virtqueue_pairs;
Christopher Ferris49f525c2016-12-12 14:55:36 -080066 __u16 mtu;
Ben Cheng655a7c02013-10-16 16:09:24 -070067} __attribute__((packed));
Christopher Ferris49f525c2016-12-12 14:55:36 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080069struct virtio_net_hdr_v1 {
Ben Cheng655a7c02013-10-16 16:09:24 -070070#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define VIRTIO_NET_HDR_F_DATA_VALID 2
Tao Baod7db5942015-01-28 10:07:51 -080072 __u8 flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define VIRTIO_NET_HDR_GSO_NONE 0
75#define VIRTIO_NET_HDR_GSO_TCPV4 1
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define VIRTIO_NET_HDR_GSO_UDP 3
77#define VIRTIO_NET_HDR_GSO_TCPV6 4
Christopher Ferris49f525c2016-12-12 14:55:36 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define VIRTIO_NET_HDR_GSO_ECN 0x80
Tao Baod7db5942015-01-28 10:07:51 -080080 __u8 gso_type;
Christopher Ferris05d08e92016-02-04 13:16:38 -080081 __virtio16 hdr_len;
82 __virtio16 gso_size;
Christopher Ferris49f525c2016-12-12 14:55:36 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080084 __virtio16 csum_start;
85 __virtio16 csum_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080086 __virtio16 num_buffers;
87};
Christopher Ferris49f525c2016-12-12 14:55:36 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080089#ifndef VIRTIO_NET_NO_LEGACY
90struct virtio_net_hdr {
Christopher Ferris05d08e92016-02-04 13:16:38 -080091 __u8 flags;
92 __u8 gso_type;
Christopher Ferris49f525c2016-12-12 14:55:36 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080094 __virtio16 hdr_len;
95 __virtio16 gso_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080096 __virtio16 csum_start;
97 __virtio16 csum_offset;
Christopher Ferris49f525c2016-12-12 14:55:36 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070099};
100struct virtio_net_hdr_mrg_rxbuf {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101 struct virtio_net_hdr hdr;
102 __virtio16 num_buffers;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700104};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800105#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700106struct virtio_net_ctrl_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800107 __u8 class;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u8 cmd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700110} __attribute__((packed));
111typedef __u8 virtio_net_ctrl_ack;
112#define VIRTIO_NET_OK 0
Christopher Ferris49f525c2016-12-12 14:55:36 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#define VIRTIO_NET_ERR 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define VIRTIO_NET_CTRL_RX 0
116#define VIRTIO_NET_CTRL_RX_PROMISC 0
117#define VIRTIO_NET_CTRL_RX_ALLMULTI 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define VIRTIO_NET_CTRL_RX_ALLUNI 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define VIRTIO_NET_CTRL_RX_NOMULTI 3
121#define VIRTIO_NET_CTRL_RX_NOUNI 4
122#define VIRTIO_NET_CTRL_RX_NOBCAST 5
Christopher Ferris49f525c2016-12-12 14:55:36 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700124struct virtio_net_ctrl_mac {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800125 __virtio32 entries;
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u8 macs[][ETH_ALEN];
Ben Cheng655a7c02013-10-16 16:09:24 -0700127} __attribute__((packed));
Christopher Ferris49f525c2016-12-12 14:55:36 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define VIRTIO_NET_CTRL_MAC 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700130#define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
131#define VIRTIO_NET_CTRL_MAC_ADDR_SET 1
132#define VIRTIO_NET_CTRL_VLAN 2
Christopher Ferris49f525c2016-12-12 14:55:36 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define VIRTIO_NET_CTRL_VLAN_ADD 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define VIRTIO_NET_CTRL_VLAN_DEL 1
136#define VIRTIO_NET_CTRL_ANNOUNCE 3
137#define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
Christopher Ferris49f525c2016-12-12 14:55:36 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700139struct virtio_net_ctrl_mq {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800140 __virtio16 virtqueue_pairs;
Ben Cheng655a7c02013-10-16 16:09:24 -0700141};
142#define VIRTIO_NET_CTRL_MQ 4
Christopher Ferris49f525c2016-12-12 14:55:36 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1
146#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800147#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
Christopher Ferris49f525c2016-12-12 14:55:36 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800149#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#endif