--- /dev/null
+/** @file\r
+ Definitions from the VirtIo 1.0 specification (csprd05).\r
+\r
+ Copyright (C) 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
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#ifndef _VIRTIO_1_0_H_\r
+#define _VIRTIO_1_0_H_\r
+\r
+#include <IndustryStandard/Virtio095.h>\r
+\r
+//\r
+// Structures for parsing the VirtIo 1.0 specific PCI capabilities from the\r
+// config space\r
+//\r
+#pragma pack (1)\r
+typedef struct {\r
+ UINT8 CapId; // Capability identifier (generic)\r
+ UINT8 CapNext; // Link to next capability (generic)\r
+} VIRTIO_PCI_CAP_LINK;\r
+\r
+typedef struct {\r
+ UINT8 ConfigType; // Identifies the specific VirtIo 1.0 config structure\r
+ UINT8 Bar; // The BAR that contains the structure\r
+ UINT8 Padding[3];\r
+ UINT32 Offset; // Offset within Bar until the start of the structure\r
+ UINT32 Length; // Length of the structure\r
+} VIRTIO_PCI_CAP;\r
+#pragma pack ()\r
+\r
+//\r
+// Values for the VIRTIO_PCI_CAP.ConfigType field\r
+//\r
+#define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration\r
+#define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications\r
+#define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration\r
+\r
+//\r
+// Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is\r
+// VIRTIO_PCI_CAP_COMMON_CFG\r
+//\r
+#pragma pack (1)\r
+typedef struct {\r
+ UINT32 DeviceFeatureSelect;\r
+ UINT32 DeviceFeature;\r
+ UINT32 DriverFeatureSelect;\r
+ UINT32 DriverFeature;\r
+ UINT16 MsixConfig;\r
+ UINT16 NumQueues;\r
+ UINT8 DeviceStatus;\r
+ UINT8 ConfigGeneration;\r
+ UINT16 QueueSelect;\r
+ UINT16 QueueSize;\r
+ UINT16 QueueMsixVector;\r
+ UINT16 QueueEnable;\r
+ UINT16 QueueNotifyOff;\r
+ UINT64 QueueDesc;\r
+ UINT64 QueueAvail;\r
+ UINT64 QueueUsed;\r
+} VIRTIO_PCI_COMMON_CFG;\r
+#pragma pack ()\r
+\r
+//\r
+// VirtIo 1.0 device status bits\r
+//\r
+#define VSTAT_FEATURES_OK BIT3\r
+\r
+//\r
+// VirtIo 1.0 reserved (device-independent) feature bits\r
+//\r
+#define VIRTIO_F_VERSION_1 BIT32\r
+\r
+#endif // _VIRTIO_1_0_H_\r
--- /dev/null
+/** @file\r
+ Definitions from the VirtIo 1.0 specification (csprd05), specifically for the\r
+ network device.\r
+\r
+ Copyright (C) 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
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#ifndef _VIRTIO_1_0_NET_H_\r
+#define _VIRTIO_1_0_NET_H_\r
+\r
+#include <IndustryStandard/Virtio10.h>\r
+#include <IndustryStandard/Virtio095Net.h>\r
+\r
+//\r
+// VirtIo 1.0 packet header\r
+//\r
+#pragma pack (1)\r
+typedef struct {\r
+ VIRTIO_NET_REQ V0_9_5;\r
+ UINT16 NumBuffers;\r
+} VIRTIO_1_0_NET_REQ;\r
+#pragma pack ()\r
+\r
+#endif // _VIRTIO_1_0_NET_H_\r