]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioBlkDxe/VirtioBlk.h
OvmfPkg/QemuBootOrderLib: sort [Sources*] sections in the INF file
[mirror_edk2.git] / OvmfPkg / VirtioBlkDxe / VirtioBlk.h
index e846dab514d78d3664110b9471b22a7194e86a4d..9ec0b956b81884ec6a05aea57d19bbd1550fe555 100644 (file)
 \r
 **/\r
 \r
+#ifndef _VIRTIO_BLK_DXE_H_\r
+#define _VIRTIO_BLK_DXE_H_\r
+\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/ComponentName.h>\r
 #include <Protocol/DriverBinding.h>\r
-#include <Protocol/PciIo.h>\r
 \r
-#include "Virtio.h"\r
+#include <IndustryStandard/Virtio.h>\r
 \r
 \r
 #define VBLK_SIG SIGNATURE_32 ('V', 'B', 'L', 'K')\r
@@ -31,14 +33,15 @@ typedef struct {
   // at various call depths. The table to the right should make it easier to\r
   // track them.\r
   //\r
-  //                    field                     init function       init dpth\r
-  //                    ----------------------    ------------------  ---------\r
-  UINT32                Signature;             // DriverBindingStart  0\r
-  EFI_PCI_IO_PROTOCOL   *PciIo;                // DriverBindingStart  0\r
-  UINT64                OriginalPciAttributes; // DriverBindingStart  0\r
-  VRING                 Ring;                  // VirtioRingInit      2\r
-  EFI_BLOCK_IO_PROTOCOL BlockIo;               // VirtioBlkInit       1\r
-  EFI_BLOCK_IO_MEDIA    BlockIoMedia;          // VirtioBlkInit       1\r
+  //                     field                    init function       init dpth\r
+  //                     ---------------------    ------------------  ---------\r
+  UINT32                 Signature;            // DriverBindingStart  0\r
+  VIRTIO_DEVICE_PROTOCOL *VirtIo;              // DriverBindingStart  0\r
+  EFI_EVENT              ExitBoot;             // DriverBindingStart  0\r
+  VRING                  Ring;                 // VirtioRingInit      2\r
+  EFI_BLOCK_IO_PROTOCOL  BlockIo;              // VirtioBlkInit       1\r
+  EFI_BLOCK_IO_MEDIA     BlockIoMedia;         // VirtioBlkInit       1\r
+  VOID                   *RingMap;             // VirtioRingMap       2\r
 } VBLK_DEV;\r
 \r
 #define VIRTIO_BLK_FROM_BLOCK_IO(BlockIoPointer) \\r
@@ -63,11 +66,6 @@ typedef struct {
       underlying device\r
     - 9 Driver Binding Protocol -- for exporting ourselves\r
 \r
-  Specs relevant in the specific sense:\r
-  - UEFI Spec 2.3.1 + Errata C, 13.4 EFI PCI I/O Protocol\r
-  - Driver Writer's Guide for UEFI 2.3.1 v1.01, 18 PCI Driver Design\r
-    Guidelines, 18.3 PCI drivers.\r
-\r
   @param[in]  This                The EFI_DRIVER_BINDING_PROTOCOL object\r
                                   incorporating this driver (independently of\r
                                   any device).\r
@@ -79,11 +77,10 @@ typedef struct {
 \r
   @retval EFI_SUCCESS      The driver supports the device being probed.\r
 \r
-  @retval EFI_UNSUPPORTED  Based on virtio-blk PCI discovery, we do not support\r
+  @retval EFI_UNSUPPORTED  Based on virtio-blk discovery, we do not support\r
                            the device.\r
 \r
-  @return                  Error codes from the OpenProtocol() boot service or\r
-                           the PciIo protocol.\r
+  @return                  Error codes from the OpenProtocol() boot service.\r
 \r
 **/\r
 \r
@@ -100,7 +97,7 @@ VirtioBlkDriverBindingSupported (
 \r
   After we've pronounced support for a specific device in\r
   DriverBindingSupported(), we start managing said device (passed in by the\r
-  Driver Exeuction Environment) with the following service.\r
+  Driver Execution Environment) with the following service.\r
 \r
   See DriverBindingSupported() for specification references.\r
 \r
@@ -114,14 +111,14 @@ VirtioBlkDriverBindingSupported (
 \r
 \r
   @retval EFI_SUCCESS           Driver instance has been created and\r
-                                initialized  for the virtio-blk PCI device, it\r
-                                is now accessibla via EFI_BLOCK_IO_PROTOCOL.\r
+                                initialized  for the virtio-blk device, it\r
+                                is now accessible via EFI_BLOCK_IO_PROTOCOL.\r
 \r
   @retval EFI_OUT_OF_RESOURCES  Memory allocation failed.\r
 \r
   @return                       Error codes from the OpenProtocol() boot\r
-                                service, the PciIo protocol, VirtioBlkInit(),\r
-                                or the InstallProtocolInterface() boot service.\r
+                                service, VirtioBlkInit(), or the\r
+                                InstallProtocolInterface() boot service.\r
 \r
 **/\r
 \r
@@ -291,3 +288,5 @@ VirtioBlkGetDeviceName (
   IN  CHAR8                       *Language,\r
   OUT CHAR16                      **ControllerName\r
   );\r
+\r
+#endif // _VIRTIO_BLK_DXE_H_\r