]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/VirtioNet.h
3 Virtio Network Device specific type and macro definitions corresponding to
4 the virtio-0.9.5 specification.
6 Copyright (C) 2013, Red Hat, Inc.
8 This program and the accompanying materials are licensed and made available
9 under the terms and conditions of the BSD License which accompanies this
10 distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
14 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _VIRTIO_NET_H_
19 #define _VIRTIO_NET_H_
21 #include <IndustryStandard/Virtio.h>
24 // virtio-0.9.5, Appendix C: Network Device
30 UINT16 VhdrLinkStatus
;
34 #define OFFSET_OF_VNET(Field) OFFSET_OF (VNET_HDR, Field)
35 #define SIZE_OF_VNET(Field) (sizeof ((VNET_HDR *) 0)->Field)
40 #define VIRTIO_NET_Q_RX 0
41 #define VIRTIO_NET_Q_TX 1
46 #define VIRTIO_NET_F_CSUM BIT0 // host to checksum outgoing packets
47 #define VIRTIO_NET_F_GUEST_CSUM BIT1 // guest to checksum incoming packets
48 #define VIRTIO_NET_F_MAC BIT5 // MAC available to guest
49 #define VIRTIO_NET_F_GSO BIT6 // deprecated
50 #define VIRTIO_NET_F_GUEST_TSO4 BIT7 // guest can receive TSOv4
51 #define VIRTIO_NET_F_GUEST_TSO6 BIT8 // guest can receive TSOv6
52 #define VIRTIO_NET_F_GUEST_ECN BIT9 // guest can receive TSO with ECN
53 #define VIRTIO_NET_F_GUEST_UFO BIT10 // guest can receive UFO
54 #define VIRTIO_NET_F_HOST_TSO4 BIT11 // host can receive TSOv4
55 #define VIRTIO_NET_F_HOST_TSO6 BIT12 // host can receive TSOv6
56 #define VIRTIO_NET_F_HOST_ECN BIT13 // host can receive TSO with ECN
57 #define VIRTIO_NET_F_HOST_UFO BIT14 // host can receive UFO
58 #define VIRTIO_NET_F_MRG_RXBUF BIT15 // guest can merge receive buffers
59 #define VIRTIO_NET_F_STATUS BIT16 // link status available to guest
60 #define VIRTIO_NET_F_CTRL_VQ BIT17 // control channel available
61 #define VIRTIO_NET_F_CTRL_RX BIT18 // control channel RX mode support
62 #define VIRTIO_NET_F_CTRL_VLAN BIT19 // control channel VLAN filtering
63 #define VIRTIO_NET_F_GUEST_ANNOUNCE BIT21 // guest can send gratuitous pkts
80 // Bits in VIRTIO_NET_REQ.Flags
82 #define VIRTIO_NET_HDR_F_NEEDS_CSUM BIT0
85 // Types/Bits for VIRTIO_NET_REQ.GsoType
87 #define VIRTIO_NET_HDR_GSO_NONE 0x00
88 #define VIRTIO_NET_HDR_GSO_TCPV4 0x01
89 #define VIRTIO_NET_HDR_GSO_UDP 0x03
90 #define VIRTIO_NET_HDR_GSO_TCPV6 0x04
91 #define VIRTIO_NET_HDR_GSO_ECN BIT7
94 // Link Status Bits in VNET_HDR.VhdrLinkStatus
96 #define VIRTIO_NET_S_LINK_UP BIT0
97 #define VIRTIO_NET_S_ANNOUNCE BIT1
99 #endif // _VIRTIO_NET_H_