1 #ifndef _LINUX_VIRTIO_NET_H
2 #define _LINUX_VIRTIO_NET_H
3 #include <linux/virtio_config.h>
5 /* The ID for virtio_net */
6 #define VIRTIO_ID_NET 1
8 /* The feature bitmap for virtio net */
9 #define VIRTIO_NET_F_NO_CSUM 0
10 #define VIRTIO_NET_F_TSO4 1
11 #define VIRTIO_NET_F_UFO 2
12 #define VIRTIO_NET_F_TSO4_ECN 3
13 #define VIRTIO_NET_F_TSO6 4
14 #define VIRTIO_NET_F_MAC 5
16 struct virtio_net_config
18 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
20 } __attribute__((packed));
22 /* This is the first element of the scatter-gather list. If you don't
23 * specify GSO or CSUM features, you can simply ignore the header. */
26 #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
28 #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
29 #define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
30 /* FIXME: Do we need this? If they said they can handle ECN, do they care? */
31 #define VIRTIO_NET_HDR_GSO_TCPV4_ECN 2 // GSO frame, IPv4 TCP w/ ECN
32 #define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
33 #define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
39 #endif /* _LINUX_VIRTIO_NET_H */