]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Virtio10.h
MdeModulePkg XhciDxe: Fix Map and Unmap inconsistency
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Virtio10.h
CommitLineData
acb81416
LE
1/** @file\r
2 Definitions from the VirtIo 1.0 specification (csprd05).\r
3\r
4 Copyright (C) 2016, Red Hat, Inc.\r
5\r
6 This program and the accompanying materials are licensed and made available\r
7 under the terms and conditions of the BSD License which accompanies this\r
8 distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
12 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13**/\r
14\r
15#ifndef _VIRTIO_1_0_H_\r
16#define _VIRTIO_1_0_H_\r
17\r
18#include <IndustryStandard/Virtio095.h>\r
19\r
92dc5e9d
LE
20//\r
21// Subsystem Device IDs (to be) introduced in VirtIo 1.0\r
22//\r
23#define VIRTIO_SUBSYSTEM_GPU_DEVICE 16\r
24\r
acb81416
LE
25//\r
26// Structures for parsing the VirtIo 1.0 specific PCI capabilities from the\r
27// config space\r
28//\r
29#pragma pack (1)\r
30typedef struct {\r
31 UINT8 CapId; // Capability identifier (generic)\r
32 UINT8 CapNext; // Link to next capability (generic)\r
33} VIRTIO_PCI_CAP_LINK;\r
34\r
35typedef struct {\r
36 UINT8 ConfigType; // Identifies the specific VirtIo 1.0 config structure\r
37 UINT8 Bar; // The BAR that contains the structure\r
38 UINT8 Padding[3];\r
39 UINT32 Offset; // Offset within Bar until the start of the structure\r
40 UINT32 Length; // Length of the structure\r
41} VIRTIO_PCI_CAP;\r
42#pragma pack ()\r
43\r
44//\r
45// Values for the VIRTIO_PCI_CAP.ConfigType field\r
46//\r
47#define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration\r
48#define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications\r
49#define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration\r
50\r
51//\r
52// Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is\r
53// VIRTIO_PCI_CAP_COMMON_CFG\r
54//\r
55#pragma pack (1)\r
56typedef struct {\r
57 UINT32 DeviceFeatureSelect;\r
58 UINT32 DeviceFeature;\r
59 UINT32 DriverFeatureSelect;\r
60 UINT32 DriverFeature;\r
61 UINT16 MsixConfig;\r
62 UINT16 NumQueues;\r
63 UINT8 DeviceStatus;\r
64 UINT8 ConfigGeneration;\r
65 UINT16 QueueSelect;\r
66 UINT16 QueueSize;\r
67 UINT16 QueueMsixVector;\r
68 UINT16 QueueEnable;\r
69 UINT16 QueueNotifyOff;\r
70 UINT64 QueueDesc;\r
71 UINT64 QueueAvail;\r
72 UINT64 QueueUsed;\r
73} VIRTIO_PCI_COMMON_CFG;\r
74#pragma pack ()\r
75\r
76//\r
77// VirtIo 1.0 device status bits\r
78//\r
79#define VSTAT_FEATURES_OK BIT3\r
80\r
81//\r
82// VirtIo 1.0 reserved (device-independent) feature bits\r
83//\r
84#define VIRTIO_F_VERSION_1 BIT32\r
85\r
86#endif // _VIRTIO_1_0_H_\r