X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FVirtioNetDxe%2FVirtioNet.h;h=3fc88cfb790e6b0b8478ebe13dfc9162b29a03c5;hb=3f20f9cf4febf0683b0d54a48aaff93eec41b0e5;hp=6762fc9d1d6e831ef770374a7a6c27537b2efc42;hpb=940baec09c8f4664b34842d13a30ce243d0b7b4b;p=mirror_edk2.git diff --git a/OvmfPkg/VirtioNetDxe/VirtioNet.h b/OvmfPkg/VirtioNetDxe/VirtioNet.h index 6762fc9d1d..3fc88cfb79 100644 --- a/OvmfPkg/VirtioNetDxe/VirtioNet.h +++ b/OvmfPkg/VirtioNetDxe/VirtioNet.h @@ -4,6 +4,7 @@ Protocol instances for virtio-net devices. Copyright (C) 2013, Red Hat, Inc. + Copyright (c) 2017, AMD Inc, All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this @@ -25,6 +26,7 @@ #include #include #include +#include #define VNET_SIG SIGNATURE_32 ('V', 'N', 'E', 'T') @@ -86,6 +88,9 @@ typedef struct { // VirtioNetInitRing UINT8 *RxBuf; // VirtioNetInitRx UINT16 RxLastUsed; // VirtioNetInitRx + UINTN RxBufNrPages; // VirtioNetInitRx + EFI_PHYSICAL_ADDRESS RxBufDeviceBase; // VirtioNetInitRx + VOID *RxBufMap; // VirtioNetInitRx VRING TxRing; // VirtioNetInitRing VOID *TxRingMap; // VirtioRingMap and @@ -93,8 +98,10 @@ typedef struct { UINT16 TxMaxPending; // VirtioNetInitTx UINT16 TxCurPending; // VirtioNetInitTx UINT16 *TxFreeStack; // VirtioNetInitTx - VIRTIO_1_0_NET_REQ TxSharedReq; // VirtioNetInitTx + VIRTIO_1_0_NET_REQ *TxSharedReq; // VirtioNetInitTx + VOID *TxSharedReqMap; // VirtioNetInitTx UINT16 TxLastUsed; // VirtioNetInitTx + ORDERED_COLLECTION *TxBufCollection; // VirtioNetInitTx } VNET_DEV; @@ -275,6 +282,42 @@ VirtioNetUninitRing ( IN VOID *RingMap ); +// +// utility functions to map caller-supplied Tx buffer system physical address +// to a device address and vice versa +// +EFI_STATUS +EFIAPI +VirtioNetMapTxBuf ( + IN VNET_DEV *Dev, + IN VOID *Buffer, + IN UINTN NumberOfBytes, + OUT EFI_PHYSICAL_ADDRESS *DeviceAddress + ); + +EFI_STATUS +EFIAPI +VirtioNetUnmapTxBuf ( + IN VNET_DEV *Dev, + OUT VOID **Buffer, + IN EFI_PHYSICAL_ADDRESS DeviceAddress + ); + +INTN +EFIAPI +VirtioNetTxBufMapInfoCompare ( + IN CONST VOID *UserStruct1, + IN CONST VOID *UserStruct2 + ); + +INTN +EFIAPI +VirtioNetTxBufDeviceAddressCompare ( + IN CONST VOID *StandaloneKey, + IN CONST VOID *UserStruct + ); + + // // event callbacks //