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