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
#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
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_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
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