14#ifndef __VIRTIO_DEVICE_H__
15#define __VIRTIO_DEVICE_H__
22#define VIRTIO_SPEC_REVISION(major, minor, revision) \
23 ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | ((revision) & 0xFFFF))
25#define VIRTIO_DEVICE_PROTOCOL_GUID {\
26 0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a }\
38 VirtioOperationBusMasterRead,
42 VirtioOperationBusMasterWrite,
47 VirtioOperationBusMasterCommonBuffer,
48} VIRTIO_MAP_OPERATION;
129 OUT UINT64 *DeviceFeatures
178 IN UINT64 RingBaseShift
289 OUT UINT16 *QueueNumMax
331 OUT UINT8 *DeviceStatus
350 IN UINT8 DeviceStatus
377 IN OUT VOID **HostAddress
439 IN VIRTIO_MAP_OPERATION Operation,
440 IN VOID *HostAddress,
483 INT32 SubSystemDeviceId;
518extern EFI_GUID gVirtioDeviceProtocolGuid;
UINT64 EFI_PHYSICAL_ADDRESS
EFI_STATUS(EFIAPI * VIRTIO_SET_QUEUE_NOTIFY)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT16 Index)
VOID(EFIAPI * VIRTIO_FREE_SHARED)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
EFI_STATUS(EFIAPI * VIRTIO_GET_DEVICE_FEATURES)(IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT64 *DeviceFeatures)
EFI_STATUS(EFIAPI * VIRTIO_GET_QUEUE_NUM_MAX)(IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT16 *QueueNumMax)
EFI_STATUS(EFIAPI * VIRTIO_GET_DEVICE_STATUS)(IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT8 *DeviceStatus)
EFI_STATUS(EFIAPI * VIRTIO_SET_QUEUE_ALIGN)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT32 Alignment)
EFI_STATUS(EFIAPI * VIRTIO_DEVICE_READ)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS(EFIAPI * VIRTIO_SET_PAGE_SIZE)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT32 PageSize)
EFI_STATUS(EFIAPI * VIRTIO_DEVICE_WRITE)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINT64 Value)
EFI_STATUS(EFIAPI * VIRTIO_SET_DEVICE_STATUS)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT8 DeviceStatus)
EFI_STATUS(EFIAPI * VIRTIO_SET_QUEUE_NUM)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT16 QueueSize)
EFI_STATUS(EFIAPI * VIRTIO_UNMAP_SHARED)(IN VIRTIO_DEVICE_PROTOCOL *This, IN VOID *Mapping)
EFI_STATUS(EFIAPI * VIRTIO_SET_GUEST_FEATURES)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT64 Features)
EFI_STATUS(EFIAPI * VIRTIO_SET_QUEUE_SEL)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT16 Index)
EFI_STATUS(EFIAPI * VIRTIO_SET_QUEUE_ADDRESS)(IN VIRTIO_DEVICE_PROTOCOL *This, IN VRING *Ring, IN UINT64 RingBaseShift)
EFI_STATUS(EFIAPI * VIRTIO_ALLOCATE_SHARED)(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN Pages, IN OUT VOID **HostAddress)
EFI_STATUS(EFIAPI * VIRTIO_MAP_SHARED)(IN VIRTIO_DEVICE_PROTOCOL *This, IN VIRTIO_MAP_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)