]>
Commit | Line | Data |
---|---|---|
9399f68a LE |
1 | /** @file\r |
2 | Private definitions of the VirtIo 1.0 driver.\r | |
3 | \r | |
4 | Copyright (C) 2016, Red Hat, Inc.\r | |
5 | \r | |
b26f0cf9 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
9399f68a LE |
7 | **/\r |
8 | \r | |
9 | #ifndef _VIRTIO_1_0_DXE_H_\r | |
10 | #define _VIRTIO_1_0_DXE_H_\r | |
11 | \r | |
12 | #include <Protocol/PciIo.h>\r | |
13 | #include <Protocol/VirtioDevice.h>\r | |
14 | \r | |
15 | #define VIRTIO_1_0_SIGNATURE SIGNATURE_32 ('V', 'I', 'O', '1')\r | |
16 | \r | |
17 | //\r | |
18 | // Type of the PCI BAR that contains a VirtIo 1.0 config structure.\r | |
19 | //\r | |
20 | typedef enum {\r | |
21 | Virtio10BarTypeMem,\r | |
22 | Virtio10BarTypeIo\r | |
23 | } VIRTIO_1_0_BAR_TYPE;\r | |
24 | \r | |
25 | //\r | |
26 | // The type below defines the access to a VirtIo 1.0 config structure.\r | |
27 | //\r | |
28 | typedef struct {\r | |
29 | BOOLEAN Exists; // The device exposes this structure\r | |
30 | VIRTIO_1_0_BAR_TYPE BarType;\r | |
31 | UINT8 Bar;\r | |
32 | UINT32 Offset; // Offset into BAR where structure starts\r | |
33 | UINT32 Length; // Length of structure in BAR.\r | |
34 | } VIRTIO_1_0_CONFIG;\r | |
35 | \r | |
36 | typedef struct {\r | |
37 | UINT32 Signature;\r | |
38 | VIRTIO_DEVICE_PROTOCOL VirtIo;\r | |
39 | EFI_PCI_IO_PROTOCOL *PciIo;\r | |
40 | UINT64 OriginalPciAttributes;\r | |
41 | VIRTIO_1_0_CONFIG CommonConfig; // Common settings\r | |
42 | VIRTIO_1_0_CONFIG NotifyConfig; // Notifications\r | |
43 | UINT32 NotifyOffsetMultiplier;\r | |
44 | VIRTIO_1_0_CONFIG SpecificConfig; // Device specific settings\r | |
45 | } VIRTIO_1_0_DEV;\r | |
46 | \r | |
47 | #define VIRTIO_1_0_FROM_VIRTIO_DEVICE(Device) \\r | |
48 | CR (Device, VIRTIO_1_0_DEV, VirtIo, VIRTIO_1_0_SIGNATURE)\r | |
49 | \r | |
50 | #endif // _VIRTIO_1_0_DXE_H_\r |