Brijesh Singh bd114d9f77 OvmfPkg/VirtioNetDxe: add Tx packet map/unmap helper functions
When device is behind IOMMU, driver is require to pass the device address
of TxBuf in the Tx VRING. The patch adds helper functions and data
structure to map and unmap the TxBuf system physical address to a device
address.

Since the TxBuf is returned back to caller from VirtioNetGetStatus() hence
we use OrderedCollection interface to save the TxBuf system physical to
device address mapping. After the TxBuf is succesfully transmitted
VirtioNetUnmapTxBuf() does the reverse lookup in OrderedCollection data
structure to get the system physical address of TxBuf for a given device
address.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2017-09-14 23:54:15 +02:00

62 lines
1.5 KiB
INI

## @file
#
# This driver produces Simple Network Protocol instances for virtio-net
# devices.
#
# Copyright (C) 2013, Red Hat, Inc.
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = VirtioNetDxe
FILE_GUID = A92CDB4B-82F1-4E0B-A516-8A655D371524
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = VirtioNetEntryPoint
[Sources]
ComponentName.c
DriverBinding.c
EntryPoint.c
Events.c
SnpGetStatus.c
SnpInitialize.c
SnpMcastIpToMac.c
SnpReceive.c
SnpReceiveFilters.c
SnpSharedHelpers.c
SnpShutdown.c
SnpStart.c
SnpStop.c
SnpTransmit.c
SnpUnsupported.c
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses]
BaseMemoryLib
DebugLib
DevicePathLib
MemoryAllocationLib
OrderedCollectionLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
VirtioLib
[Protocols]
gEfiSimpleNetworkProtocolGuid ## BY_START
gEfiDevicePathProtocolGuid ## BY_START
gVirtioDeviceProtocolGuid ## TO_START