1 /**************************************************************************** 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 ****************************************************************************/ 19 #ifndef _LINUX_VIRTIO_NET_H 20 #define _LINUX_VIRTIO_NET_H 21 #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> 25 #include <linux/if_ether.h> 26 #define VIRTIO_NET_F_CSUM 0 27 #define VIRTIO_NET_F_GUEST_CSUM 1 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define VIRTIO_NET_F_MAC 5 30 #define VIRTIO_NET_F_GSO 6 31 #define VIRTIO_NET_F_GUEST_TSO4 7 32 #define VIRTIO_NET_F_GUEST_TSO6 8 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define VIRTIO_NET_F_GUEST_ECN 9 35 #define VIRTIO_NET_F_GUEST_UFO 10 36 #define VIRTIO_NET_F_HOST_TSO4 11 37 #define VIRTIO_NET_F_HOST_TSO6 12 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 #define VIRTIO_NET_F_HOST_ECN 13 40 #define VIRTIO_NET_F_HOST_UFO 14 41 #define VIRTIO_NET_F_MRG_RXBUF 15 42 #define VIRTIO_NET_F_STATUS 16 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 #define VIRTIO_NET_F_CTRL_VQ 17 45 #define VIRTIO_NET_F_CTRL_RX 18 46 #define VIRTIO_NET_F_CTRL_VLAN 19 47 #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 50 #define VIRTIO_NET_F_MQ 22 51 #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 52 #define VIRTIO_NET_S_LINK_UP 1 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 #define VIRTIO_NET_S_ANNOUNCE 2 55 struct virtio_net_config { 56 __u8 mac[6]; 57 __u16 status; 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 __u16 max_virtqueue_pairs; 60 } __attribute__((packed)); 61 struct virtio_net_hdr { 62 #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 #define VIRTIO_NET_HDR_F_DATA_VALID 2 65 __u8 flags; 66 #define VIRTIO_NET_HDR_GSO_NONE 0 67 #define VIRTIO_NET_HDR_GSO_TCPV4 1 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 #define VIRTIO_NET_HDR_GSO_UDP 3 70 #define VIRTIO_NET_HDR_GSO_TCPV6 4 71 #define VIRTIO_NET_HDR_GSO_ECN 0x80 72 __u8 gso_type; 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 __u16 hdr_len; 75 __u16 gso_size; 76 __u16 csum_start; 77 __u16 csum_offset; 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 }; 80 struct virtio_net_hdr_mrg_rxbuf { 81 struct virtio_net_hdr hdr; 82 __u16 num_buffers; 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 }; 85 struct virtio_net_ctrl_hdr { 86 __u8 class; 87 __u8 cmd; 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 } __attribute__((packed)); 90 typedef __u8 virtio_net_ctrl_ack; 91 #define VIRTIO_NET_OK 0 92 #define VIRTIO_NET_ERR 1 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 #define VIRTIO_NET_CTRL_RX 0 95 #define VIRTIO_NET_CTRL_RX_PROMISC 0 96 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 97 #define VIRTIO_NET_CTRL_RX_ALLUNI 2 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 #define VIRTIO_NET_CTRL_RX_NOMULTI 3 100 #define VIRTIO_NET_CTRL_RX_NOUNI 4 101 #define VIRTIO_NET_CTRL_RX_NOBCAST 5 102 struct virtio_net_ctrl_mac { 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 __u32 entries; 105 __u8 macs[][ETH_ALEN]; 106 } __attribute__((packed)); 107 #define VIRTIO_NET_CTRL_MAC 1 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0 110 #define VIRTIO_NET_CTRL_MAC_ADDR_SET 1 111 #define VIRTIO_NET_CTRL_VLAN 2 112 #define VIRTIO_NET_CTRL_VLAN_ADD 0 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 #define VIRTIO_NET_CTRL_VLAN_DEL 1 115 #define VIRTIO_NET_CTRL_ANNOUNCE 3 116 #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0 117 struct virtio_net_ctrl_mq { 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 __u16 virtqueue_pairs; 120 }; 121 #define VIRTIO_NET_CTRL_MQ 4 122 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1 125 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000 126 #endif 127