]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/IndustryStandard/VirtioNet.h
OvmfPkg/Virtio: take RingBaseShift in SetQueueAddress()
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / VirtioNet.h
index 34bf15a5883d73f8d5d3e890db8cefeef038b0a8..9b0bfdc585d03ec98249b7dbf70b8c888010744d 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Virtio Network Device specific type and macro definitions corresponding to\r
-  the virtio-0.9.5 specification.\r
+  the virtio specifications.\r
 \r
-  Copyright (C) 2013, Red Hat, Inc.\r
+  Copyright (C) 2013-2016, Red Hat, Inc.\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
 #ifndef _VIRTIO_NET_H_\r
 #define _VIRTIO_NET_H_\r
 \r
-#include <IndustryStandard/Virtio.h>\r
-\r
-//\r
-// virtio-0.9.5, Appendix C: Network Device\r
-//\r
-#pragma pack(1)\r
-typedef struct {\r
-  UINT8      Mac[6];\r
-  UINT16     LinkStatus;\r
-} VIRTIO_NET_CONFIG;\r
-#pragma pack()\r
-\r
-#define OFFSET_OF_VNET(Field) OFFSET_OF (VIRTIO_NET_CONFIG, Field)\r
-#define SIZE_OF_VNET(Field)   (sizeof ((VIRTIO_NET_CONFIG *) 0)->Field)\r
-\r
-//\r
-// Queue Identifiers\r
-//\r
-#define VIRTIO_NET_Q_RX 0\r
-#define VIRTIO_NET_Q_TX 1\r
-\r
-//\r
-// Feature Bits\r
-//\r
-#define VIRTIO_NET_F_CSUM           BIT0  // host to checksum outgoing packets\r
-#define VIRTIO_NET_F_GUEST_CSUM     BIT1  // guest to checksum incoming packets\r
-#define VIRTIO_NET_F_MAC            BIT5  // MAC available to guest\r
-#define VIRTIO_NET_F_GSO            BIT6  // deprecated\r
-#define VIRTIO_NET_F_GUEST_TSO4     BIT7  // guest can receive TSOv4\r
-#define VIRTIO_NET_F_GUEST_TSO6     BIT8  // guest can receive TSOv6\r
-#define VIRTIO_NET_F_GUEST_ECN      BIT9  // guest can receive TSO with ECN\r
-#define VIRTIO_NET_F_GUEST_UFO      BIT10 // guest can receive UFO\r
-#define VIRTIO_NET_F_HOST_TSO4      BIT11 // host can receive TSOv4\r
-#define VIRTIO_NET_F_HOST_TSO6      BIT12 // host can receive TSOv6\r
-#define VIRTIO_NET_F_HOST_ECN       BIT13 // host can receive TSO with ECN\r
-#define VIRTIO_NET_F_HOST_UFO       BIT14 // host can receive UFO\r
-#define VIRTIO_NET_F_MRG_RXBUF      BIT15 // guest can merge receive buffers\r
-#define VIRTIO_NET_F_STATUS         BIT16 // link status available to guest\r
-#define VIRTIO_NET_F_CTRL_VQ        BIT17 // control channel available\r
-#define VIRTIO_NET_F_CTRL_RX        BIT18 // control channel RX mode support\r
-#define VIRTIO_NET_F_CTRL_VLAN      BIT19 // control channel VLAN filtering\r
-#define VIRTIO_NET_F_GUEST_ANNOUNCE BIT21 // guest can send gratuitous pkts\r
-\r
-//\r
-// Packet Header\r
-//\r
-#pragma pack(1)\r
-typedef struct {\r
-  UINT8  Flags;\r
-  UINT8  GsoType;\r
-  UINT16 HdrLen;\r
-  UINT16 GsoSize;\r
-  UINT16 CsumStart;\r
-  UINT16 CsumOffset;\r
-} VIRTIO_NET_REQ;\r
-#pragma pack()\r
-\r
-//\r
-// Bits in VIRTIO_NET_REQ.Flags\r
-//\r
-#define VIRTIO_NET_HDR_F_NEEDS_CSUM BIT0\r
-\r
-//\r
-// Types/Bits for VIRTIO_NET_REQ.GsoType\r
-//\r
-#define VIRTIO_NET_HDR_GSO_NONE  0x00\r
-#define VIRTIO_NET_HDR_GSO_TCPV4 0x01\r
-#define VIRTIO_NET_HDR_GSO_UDP   0x03\r
-#define VIRTIO_NET_HDR_GSO_TCPV6 0x04\r
-#define VIRTIO_NET_HDR_GSO_ECN   BIT7\r
-\r
-//\r
-// Link Status Bits in VIRTIO_NET_CONFIG.LinkStatus\r
-//\r
-#define VIRTIO_NET_S_LINK_UP  BIT0\r
-#define VIRTIO_NET_S_ANNOUNCE BIT1\r
+#include <IndustryStandard/Virtio10Net.h>\r
 \r
 #endif // _VIRTIO_NET_H_\r