]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Virtio10.h
OvmfPkg: IndustryStandard: add definitions from the VirtIo 1.0 spec
[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
20//\r
21// Structures for parsing the VirtIo 1.0 specific PCI capabilities from the\r
22// config space\r
23//\r
24#pragma pack (1)\r
25typedef struct {\r
26 UINT8 CapId; // Capability identifier (generic)\r
27 UINT8 CapNext; // Link to next capability (generic)\r
28} VIRTIO_PCI_CAP_LINK;\r
29\r
30typedef struct {\r
31 UINT8 ConfigType; // Identifies the specific VirtIo 1.0 config structure\r
32 UINT8 Bar; // The BAR that contains the structure\r
33 UINT8 Padding[3];\r
34 UINT32 Offset; // Offset within Bar until the start of the structure\r
35 UINT32 Length; // Length of the structure\r
36} VIRTIO_PCI_CAP;\r
37#pragma pack ()\r
38\r
39//\r
40// Values for the VIRTIO_PCI_CAP.ConfigType field\r
41//\r
42#define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration\r
43#define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications\r
44#define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration\r
45\r
46//\r
47// Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is\r
48// VIRTIO_PCI_CAP_COMMON_CFG\r
49//\r
50#pragma pack (1)\r
51typedef struct {\r
52 UINT32 DeviceFeatureSelect;\r
53 UINT32 DeviceFeature;\r
54 UINT32 DriverFeatureSelect;\r
55 UINT32 DriverFeature;\r
56 UINT16 MsixConfig;\r
57 UINT16 NumQueues;\r
58 UINT8 DeviceStatus;\r
59 UINT8 ConfigGeneration;\r
60 UINT16 QueueSelect;\r
61 UINT16 QueueSize;\r
62 UINT16 QueueMsixVector;\r
63 UINT16 QueueEnable;\r
64 UINT16 QueueNotifyOff;\r
65 UINT64 QueueDesc;\r
66 UINT64 QueueAvail;\r
67 UINT64 QueueUsed;\r
68} VIRTIO_PCI_COMMON_CFG;\r
69#pragma pack ()\r
70\r
71//\r
72// VirtIo 1.0 device status bits\r
73//\r
74#define VSTAT_FEATURES_OK BIT3\r
75\r
76//\r
77// VirtIo 1.0 reserved (device-independent) feature bits\r
78//\r
79#define VIRTIO_F_VERSION_1 BIT32\r
80\r
81#endif // _VIRTIO_1_0_H_\r