]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioNetDxe/VirtioNet.h
OvmfPkg: Fix build failure due to Tftp library removal
[mirror_edk2.git] / OvmfPkg / VirtioNetDxe / VirtioNet.h
index 710859bc61159fee360494eb09a03d15baa378b1..3fc88cfb790e6b0b8478ebe13dfc9162b29a03c5 100644 (file)
@@ -4,6 +4,7 @@
   Protocol instances for virtio-net devices.\r
 \r
   Copyright (C) 2013, Red Hat, Inc.\r
+  Copyright (c) 2017, AMD Inc, All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
@@ -25,6 +26,7 @@
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/SimpleNetwork.h>\r
+#include <Library/OrderedCollectionLib.h>\r
 \r
 #define VNET_SIG SIGNATURE_32 ('V', 'N', 'E', 'T')\r
 \r
@@ -82,15 +84,24 @@ typedef struct {
   EFI_HANDLE                  MacHandle;         // VirtioNetDriverBindingStart\r
 \r
   VRING                       RxRing;            // VirtioNetInitRing\r
+  VOID                        *RxRingMap;        // VirtioRingMap and\r
+                                                 // VirtioNetInitRing\r
   UINT8                       *RxBuf;            // VirtioNetInitRx\r
   UINT16                      RxLastUsed;        // VirtioNetInitRx\r
+  UINTN                       RxBufNrPages;      // VirtioNetInitRx\r
+  EFI_PHYSICAL_ADDRESS        RxBufDeviceBase;   // VirtioNetInitRx\r
+  VOID                        *RxBufMap;         // VirtioNetInitRx\r
 \r
   VRING                       TxRing;            // VirtioNetInitRing\r
+  VOID                        *TxRingMap;        // VirtioRingMap and\r
+                                                 // VirtioNetInitRing\r
   UINT16                      TxMaxPending;      // VirtioNetInitTx\r
   UINT16                      TxCurPending;      // VirtioNetInitTx\r
   UINT16                      *TxFreeStack;      // VirtioNetInitTx\r
-  VIRTIO_1_0_NET_REQ          TxSharedReq;       // VirtioNetInitTx\r
+  VIRTIO_1_0_NET_REQ          *TxSharedReq;      // VirtioNetInitTx\r
+  VOID                        *TxSharedReqMap;   // VirtioNetInitTx\r
   UINT16                      TxLastUsed;        // VirtioNetInitTx\r
+  ORDERED_COLLECTION          *TxBufCollection;  // VirtioNetInitTx\r
 } VNET_DEV;\r
 \r
 \r
@@ -263,6 +274,50 @@ VirtioNetShutdownTx (
   IN OUT VNET_DEV *Dev\r
   );\r
 \r
+VOID\r
+EFIAPI\r
+VirtioNetUninitRing (\r
+  IN OUT VNET_DEV *Dev,\r
+  IN OUT VRING    *Ring,\r
+  IN     VOID     *RingMap\r
+  );\r
+\r
+//\r
+// utility functions to map caller-supplied Tx buffer system physical address\r
+// to a device address and vice versa\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioNetMapTxBuf (\r
+  IN  VNET_DEV              *Dev,\r
+  IN  VOID                  *Buffer,\r
+  IN  UINTN                 NumberOfBytes,\r
+  OUT EFI_PHYSICAL_ADDRESS  *DeviceAddress\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioNetUnmapTxBuf (\r
+  IN  VNET_DEV              *Dev,\r
+  OUT VOID                  **Buffer,\r
+  IN  EFI_PHYSICAL_ADDRESS  DeviceAddress\r
+  );\r
+\r
+INTN\r
+EFIAPI\r
+VirtioNetTxBufMapInfoCompare (\r
+  IN CONST VOID *UserStruct1,\r
+  IN CONST VOID *UserStruct2\r
+  );\r
+\r
+INTN\r
+EFIAPI\r
+VirtioNetTxBufDeviceAddressCompare (\r
+  IN CONST VOID *StandaloneKey,\r
+  IN CONST VOID *UserStruct\r
+  );\r
+\r
+\r
 //\r
 // event callbacks\r
 //\r