TianoCore EDK2 master
|
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/VirtioLib.h>
#include "VirtioRng.h"
Go to the source code of this file.
This driver produces EFI_RNG_PROTOCOL instances for virtio-rng devices.
The implementation is based on OvmfPkg/VirtioScsiDxe/VirtioScsi.c
Copyright (C) 2012, Red Hat, Inc. Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Inc, All rights reserved.
This driver:
Copyright (C) 2016, Linaro Ltd.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Definition at line 523 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Definition at line 608 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Definition at line 475 of file VirtioRng.c.
EFI_STATUS EFIAPI VirtioRngEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Definition at line 744 of file VirtioRng.c.
Definition at line 437 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngGetDeviceName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN EFI_HANDLE | DeviceHandle, | ||
IN EFI_HANDLE | ChildHandle, | ||
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | ControllerName | ||
) |
Definition at line 714 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngGetDriverName | ( | IN EFI_COMPONENT_NAME_PROTOCOL * | This, |
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | DriverName | ||
) |
Definition at line 696 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngGetInfo | ( | IN EFI_RNG_PROTOCOL * | This, |
IN OUT UINTN * | RNGAlgorithmListSize, | ||
OUT EFI_RNG_ALGORITHM * | RNGAlgorithmList | ||
) |
Returns information about the random number generation implementation.
[in] | This | A pointer to the EFI_RNG_PROTOCOL instance. |
[in,out] | RNGAlgorithmListSize | On input, the size in bytes of RNGAlgorithmList. On output with a return code of EFI_SUCCESS, the size in bytes of the data returned in RNGAlgorithmList. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of RNGAlgorithmList required to obtain the list. |
[out] | RNGAlgorithmList | A caller-allocated memory buffer filled by the driver with one EFI_RNG_ALGORITHM element for each supported RNG algorithm. The list must not change across multiple calls to the same driver. The first algorithm in the list is the default algorithm for the driver. |
EFI_SUCCESS | The RNG algorithm list was returned successfully. |
EFI_UNSUPPORTED | The services is not supported by this driver. |
EFI_DEVICE_ERROR | The list of algorithms could not be retrieved due to a hardware or firmware error. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. |
EFI_BUFFER_TOO_SMALL | The buffer RNGAlgorithmList is too small to hold the result. |
Definition at line 66 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngGetRNG | ( | IN EFI_RNG_PROTOCOL * | This, |
IN EFI_RNG_ALGORITHM *RNGAlgorithm | OPTIONAL, | ||
IN UINTN | RNGValueLength, | ||
OUT UINT8 * | RNGValue | ||
) |
Produces and returns an RNG value using either the default or specified RNG algorithm.
[in] | This | A pointer to the EFI_RNG_PROTOCOL instance. |
[in] | RNGAlgorithm | A pointer to the EFI_RNG_ALGORITHM that identifies the RNG algorithm to use. May be NULL in which case the function will use its default RNG algorithm. |
[in] | RNGValueLength | The length in bytes of the memory buffer pointed to by RNGValue. The driver shall return exactly this numbers of bytes. |
[out] | RNGValue | A caller-allocated memory buffer filled by the driver with the resulting RNG value. |
EFI_SUCCESS | The RNG value was returned successfully. |
EFI_UNSUPPORTED | The algorithm specified by RNGAlgorithm is not supported by this driver. |
EFI_DEVICE_ERROR | An RNG value could not be retrieved due to a hardware or firmware error. |
EFI_NOT_READY | There is not enough random data available to satisfy the length requested by RNGValueLength. |
EFI_INVALID_PARAMETER | RNGValue is NULL or RNGValueLength is zero. |
Definition at line 123 of file VirtioRng.c.
STATIC EFI_STATUS EFIAPI VirtioRngInit | ( | IN OUT VIRTIO_RNG_DEV * | Dev | ) |
Definition at line 240 of file VirtioRng.c.
STATIC VOID EFIAPI VirtioRngUninit | ( | IN OUT VIRTIO_RNG_DEV * | Dev | ) |
Definition at line 414 of file VirtioRng.c.
STATIC EFI_COMPONENT_NAME_PROTOCOL gComponentName |
Definition at line 691 of file VirtioRng.c.
STATIC EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 |
Definition at line 733 of file VirtioRng.c.
STATIC EFI_DRIVER_BINDING_PROTOCOL gDriverBinding |
Definition at line 666 of file VirtioRng.c.
STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable[] |
Definition at line 685 of file VirtioRng.c.