TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | TX_BUF_MAP_INFO |
Functions | |
VOID EFIAPI | VirtioNetShutdownRx (IN OUT VNET_DEV *Dev) |
VOID EFIAPI | VirtioNetShutdownTx (IN OUT VNET_DEV *Dev) |
VOID EFIAPI | VirtioNetUninitRing (IN OUT VNET_DEV *Dev, IN OUT VRING *Ring, IN VOID *RingMap) |
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) |
Helper functions used by at least two Simple Network Protocol methods.
Copyright (C) 2013, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SnpSharedHelpers.c.
EFI_STATUS EFIAPI VirtioNetMapTxBuf | ( | IN VNET_DEV * | Dev, |
IN VOID * | Buffer, | ||
IN UINTN | NumberOfBytes, | ||
OUT EFI_PHYSICAL_ADDRESS * | DeviceAddress | ||
) |
Map Caller-supplied TxBuf buffer to the device-mapped address
[in] | Dev | The VNET_DEV driver instance which wants to map the Tx packet. |
[in] | Buffer | The system physical address of TxBuf |
[in] | NumberOfBytes | Number of bytes to map |
[out] | DeviceAddress | The resulting device address for the bus master access. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
EFI_SUCCESS | Caller-supplied buffer is successfully mapped. |
Definition at line 124 of file SnpSharedHelpers.c.
Release RX and TX resources on the boundary of the EfiSimpleNetworkInitialized state.
These functions contribute to rolling back a partial, failed initialization of the virtio-net SNP driver instance, or to shutting down a fully initialized, running instance.
They are only callable by the VirtioNetInitialize() and the VirtioNetShutdown() SNP methods. See the state diagram in "VirtioNet.h".
[in,out] | Dev | The VNET_DEV driver instance being shut down, or whose partial, failed initialization is being rolled back. |
Definition at line 41 of file SnpSharedHelpers.c.
Definition at line 55 of file SnpSharedHelpers.c.
INTN EFIAPI VirtioNetTxBufDeviceAddressCompare | ( | IN CONST VOID * | StandaloneKey, |
IN CONST VOID * | UserStruct | ||
) |
Compare a standalone DeviceAddress against a TX_BUF_MAP_INFO object containing an embedded DeviceAddress.
[in] | StandaloneKey | Pointer to DeviceAddress, which has type EFI_PHYSICAL_ADDRESS. |
[in] | UserStruct | Pointer to the TX_BUF_MAP_INFO object with the embedded DeviceAddress. |
<0 | If StandaloneKey compares less than UserStruct's key. |
0 | If StandaloneKey compares equal to UserStruct's key. |
>0 | If StandaloneKey compares greater than UserStruct's key. |
Definition at line 288 of file SnpSharedHelpers.c.
INTN EFIAPI VirtioNetTxBufMapInfoCompare | ( | IN CONST VOID * | UserStruct1, |
IN CONST VOID * | UserStruct2 | ||
) |
Comparator function for two TX_BUF_MAP_INFO objects.
[in] | UserStruct1 | Pointer to the first TX_BUF_MAP_INFO object. |
[in] | UserStruct2 | Pointer to the second TX_BUF_MAP_INFO object. |
<0 | If UserStruct1 compares less than UserStruct2. |
0 | If UserStruct1 compares equal to UserStruct2. |
>0 | If UserStruct1 compares greater than UserStruct2. |
Definition at line 254 of file SnpSharedHelpers.c.
Release TX and RX VRING resources.
[in,out] | Dev | The VNET_DEV driver instance which was using the ring. |
[in,out] | Ring | The virtio ring to clean up. |
[in] | RingMap | A token return from the VirtioRingMap() |
Definition at line 96 of file SnpSharedHelpers.c.
EFI_STATUS EFIAPI VirtioNetUnmapTxBuf | ( | IN VNET_DEV * | Dev, |
OUT VOID ** | Buffer, | ||
IN EFI_PHYSICAL_ADDRESS | DeviceAddress | ||
) |
Unmap (aka reverse mapping) device mapped TxBuf buffer to the system physical address
[in] | Dev | The VNET_DEV driver instance which wants to reverse- and unmap the Tx packet. |
[out] | Buffer | The system physical address of TxBuf |
[in] | DeviceAddress | The device address for the TxBuf |
EFI_INVALID_PARAMETER | The DeviceAddress is not mapped |
EFI_SUCCESS | The TxBuf at DeviceAddress has been unmapped, and Buffer has been set to TxBuf's system physical address. |
Definition at line 213 of file SnpSharedHelpers.c.