TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include "VirtioNet.h"
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS EFIAPI | VirtioNetInitRing (IN OUT VNET_DEV *Dev, IN UINT16 Selector, OUT VRING *Ring, OUT VOID **Mapping) |
STATIC EFI_STATUS EFIAPI | VirtioNetInitTx (IN OUT VNET_DEV *Dev) |
STATIC EFI_STATUS EFIAPI | VirtioNetInitRx (IN OUT VNET_DEV *Dev) |
EFI_STATUS EFIAPI | VirtioNetInitialize (IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL) |
Implementation of the SNP.Initialize() function and its private helpers if any.
Copyright (C) 2013, Red Hat, Inc. Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Inc, All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SnpInitialize.c.
EFI_STATUS EFIAPI VirtioNetInitialize | ( | IN EFI_SIMPLE_NETWORK_PROTOCOL * | This, |
IN UINTN ExtraRxBufferSize | OPTIONAL, | ||
IN UINTN ExtraTxBufferSize | OPTIONAL | ||
) |
Resets a network adapter and allocates the transmit and receive buffers required by the network interface; optionally, also requests allocation of additional transmit and receive buffers.
This | The protocol instance pointer. |
ExtraRxBufferSize | The size, in bytes, of the extra receive buffer space that the driver should allocate for the network interface. Some network interfaces will not be able to use the extra buffer, and the caller will not know if it is actually being used. |
ExtraTxBufferSize | The size, in bytes, of the extra transmit buffer space that the driver should allocate for the network interface. Some network interfaces will not be able to use the extra buffer, and the caller will not know if it is actually being used. |
EFI_SUCCESS | The network interface was initialized. |
EFI_NOT_STARTED | The network interface has not been started. |
EFI_OUT_OF_RESOURCES | There was not enough memory for the transmit and receive buffers. |
EFI_INVALID_PARAMETER | One or more of the parameters has an unsupported value. |
EFI_DEVICE_ERROR | The command could not be sent to the network interface. |
EFI_UNSUPPORTED | This function is not supported by the network interface. |
Definition at line 489 of file SnpInitialize.c.
STATIC EFI_STATUS EFIAPI VirtioNetInitRing | ( | IN OUT VNET_DEV * | Dev, |
IN UINT16 | Selector, | ||
OUT VRING * | Ring, | ||
OUT VOID ** | Mapping | ||
) |
Initialize a virtio ring for a specific transfer direction of the virtio-net device.
This function may only be called by VirtioNetInitialize().
[in,out] | Dev | The VNET_DEV driver instance about to enter the EfiSimpleNetworkInitialized state. |
[in] | Selector | Identifies the transfer direction (virtio queue) of the network device. |
[out] | Ring | The virtio-ring inside the VNET_DEV structure, corresponding to Selector. |
[out] | Mapping | A resulting token to pass to VirtioNetUninitRing() |
EFI_UNSUPPORTED | The queue size reported by the virtio-net device is too small. |
EFI_SUCCESS | Ring initialized. |
Definition at line 45 of file SnpInitialize.c.
STATIC EFI_STATUS EFIAPI VirtioNetInitRx | ( | IN OUT VNET_DEV * | Dev | ) |
Set up static scaffolding for the VirtioNetReceive() SNP method and enable live device operation.
This function may only be called as VirtioNetInitialize()'s final step.
The structures laid out and resources configured include:
[in,out] | Dev | The VNET_DEV driver instance about to enter the EfiSimpleNetworkInitialized state. |
EFI_SUCCESS | RX setup successful. The device is live and may already be writing to the receive area. |
Definition at line 311 of file SnpInitialize.c.
STATIC EFI_STATUS EFIAPI VirtioNetInitTx | ( | IN OUT VNET_DEV * | Dev | ) |
Set up static scaffolding for the VirtioNetTransmit() and VirtioNetGetStatus() SNP methods.
This function may only be called by VirtioNetInitialize().
The structures laid out and resources configured include:
[in,out] | Dev | The VNET_DEV driver instance about to enter the EfiSimpleNetworkInitialized state. |
EFI_OUT_OF_RESOURCES | Failed to allocate the stack to track the heads of free descriptor chains or failed to init TxBufCollection. |
EFI_SUCCESS | TX setup successful. |
Definition at line 154 of file SnpInitialize.c.