TianoCore EDK2 master
Loading...
Searching...
No Matches
VirtioPciDevice.h
Go to the documentation of this file.
1
12#ifndef _VIRTIO_PCI_DEVICE_DXE_H_
13#define _VIRTIO_PCI_DEVICE_DXE_H_
14
17#include <Protocol/PciIo.h>
19
21
22#define VIRTIO_PCI_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'P', 'C', 'I')
23
24typedef struct {
25 UINT32 Signature;
26 VIRTIO_DEVICE_PROTOCOL VirtioDevice;
28 UINT64 OriginalPciAttributes;
29 UINT32 DeviceSpecificConfigurationOffset;
31
32#define VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE(Device) \
33 CR (Device, VIRTIO_PCI_DEVICE, VirtioDevice, VIRTIO_PCI_DEVICE_SIGNATURE)
34
36EFIAPI
39 IN UINTN FieldOffset,
40 IN UINTN FieldSize,
41 IN UINTN BufferSize,
42 OUT VOID *Buffer
43 );
44
46EFIAPI
49 IN UINTN FieldOffset,
50 IN UINTN FieldSize,
51 IN UINT64 Value
52 );
53
54/********************************************
55 * PCI Functions for VIRTIO_DEVICE_PROTOCOL
56 *******************************************/
58EFIAPI
61 IN UINTN FieldOffset,
62 IN UINTN FieldSize,
63 IN UINTN BufferSize,
64 OUT VOID *Buffer
65 );
66
68EFIAPI
71 IN UINTN FieldOffset,
72 IN UINTN FieldSize,
73 IN UINT64 Value
74 );
75
77EFIAPI
78VirtioPciGetDeviceFeatures (
80 OUT UINT64 *DeviceFeatures
81 );
82
84EFIAPI
85VirtioPciGetQueueSize (
87 OUT UINT16 *QueueNumMax
88 );
89
91EFIAPI
92VirtioPciSetQueueAlignment (
94 IN UINT32 Alignment
95 );
96
98EFIAPI
99VirtioPciSetPageSize (
101 IN UINT32 PageSize
102 );
103
105EFIAPI
106VirtioPciGetDeviceStatus (
108 OUT UINT8 *DeviceStatus
109 );
110
112EFIAPI
113VirtioPciSetGuestFeatures (
115 IN UINT64 Features
116 );
117
119EFIAPI
120VirtioPciSetQueueAddress (
122 IN VRING *Ring,
123 IN UINT64 RingBaseShift
124 );
125
127EFIAPI
128VirtioPciSetQueueSel (
130 IN UINT16 Sel
131 );
132
134EFIAPI
135VirtioPciSetQueueNotify (
137 IN UINT16 Index
138 );
139
141EFIAPI
142VirtioPciSetQueueSize (
144 IN UINT16 Size
145 );
146
148EFIAPI
149VirtioPciSetDeviceStatus (
151 IN UINT8 DeviceStatus
152 );
153
155EFIAPI
156VirtioPciAllocateSharedPages (
158 IN UINTN NumPages,
159 OUT VOID **HostAddress
160 );
161
162VOID
163EFIAPI
164VirtioPciFreeSharedPages (
166 IN UINTN NumPages,
167 IN VOID *HostAddress
168 );
169
171EFIAPI
172VirtioPciMapSharedBuffer (
174 IN VIRTIO_MAP_OPERATION Operation,
175 IN VOID *HostAddress,
176 IN OUT UINTN *NumberOfBytes,
177 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
178 OUT VOID **Mapping
179 );
180
182EFIAPI
183VirtioPciUnmapSharedBuffer (
185 IN VOID *Mapping
186 );
187
188#endif // _VIRTIO_PCI_DEVICE_DXE_H_
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_STATUS EFIAPI VirtioPciIoRead(IN VIRTIO_PCI_DEVICE *Dev, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI VirtioPciIoWrite(IN VIRTIO_PCI_DEVICE *Dev, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINT64 Value)
EFI_STATUS EFIAPI VirtioPciDeviceWrite(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINT64 Value)
EFI_STATUS EFIAPI VirtioPciDeviceRead(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINTN BufferSize, OUT VOID *Buffer)