TianoCore EDK2 master
|
#include "HttpBootDxe.h"
Go to the source code of this file.
Variables | |
GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FILE_PROTOCOL | gHttpBootDxeLoadFile |
GLOBAL_REMOVE_IF_UNREFERENCED EFI_HTTP_BOOT_CALLBACK_PROTOCOL | gHttpBootDxeHttpBootCallback |
The implementation of EFI_LOAD_FILE_PROTOCOL for UEFI HTTP boot.
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HttpBootImpl.c.
EFI_STATUS EFIAPI HttpBootCallback | ( | IN EFI_HTTP_BOOT_CALLBACK_PROTOCOL * | This, |
IN EFI_HTTP_BOOT_CALLBACK_DATA_TYPE | DataType, | ||
IN BOOLEAN | Received, | ||
IN UINT32 | DataLength, | ||
IN VOID *Data | OPTIONAL | ||
) |
Callback function that is invoked when the HTTP Boot driver is about to transmit or has received a packet.
This function is invoked when the HTTP Boot driver is about to transmit or has received packet. Parameters DataType and Received specify the type of event and the format of the buffer pointed to by Data. Due to the polling nature of UEFI device drivers, this callback function should not execute for more than 5 ms. The returned status code determines the behavior of the HTTP Boot driver.
[in] | This | Pointer to the EFI_HTTP_BOOT_CALLBACK_PROTOCOL instance. |
[in] | DataType | The event that occurs in the current state. |
[in] | Received | TRUE if the callback is being invoked due to a receive event. FALSE if the callback is being invoked due to a transmit event. |
[in] | DataLength | The length in bytes of the buffer pointed to by Data. |
[in] | Data | A pointer to the buffer of data, the data type is specified by DataType. |
EFI_SUCCESS | Tells the HTTP Boot driver to continue the HTTP Boot process. |
EFI_ABORTED | Tells the HTTP Boot driver to abort the current HTTP Boot process. |
Definition at line 786 of file HttpBootImpl.c.
EFI_STATUS HttpBootDhcp | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Attempt to complete a DHCPv4 D.O.R.A or DHCPv6 S.R.A.A sequence to retrieve the boot resource information.
[in] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | Boot info was successfully retrieved. |
EFI_INVALID_PARAMETER | Private is NULL. |
EFI_NOT_STARTED | The driver is in stopped state. |
EFI_DEVICE_ERROR | An unexpected network error occurred. |
Others | Other errors as indicated. |
Definition at line 254 of file HttpBootImpl.c.
EFI_STATUS EFIAPI HttpBootDxeLoadFile | ( | IN EFI_LOAD_FILE_PROTOCOL * | This, |
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, | ||
IN BOOLEAN | BootPolicy, | ||
IN OUT UINTN * | BufferSize, | ||
IN VOID *Buffer | OPTIONAL | ||
) |
Causes the driver to load a specified file.
This | Protocol instance pointer. |
FilePath | The device specific path of the file to load. |
BootPolicy | If TRUE, indicates that the request originates from the boot manager is attempting to load FilePath as a boot selection. If FALSE, then FilePath must match as exact file to be loaded. |
BufferSize | On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file. |
Buffer | The memory buffer to transfer the file to. IF Buffer is NULL, then the size of the requested file is returned in BufferSize. |
EFI_SUCCESS | The file was loaded. |
EFI_UNSUPPORTED | The device does not support the provided BootPolicy |
EFI_INVALID_PARAMETER | FilePath is not a valid device path, or BufferSize is NULL. |
EFI_NO_MEDIA | No medium was present to load the file. |
EFI_DEVICE_ERROR | The file was not loaded due to a device error. |
EFI_NO_RESPONSE | The remote system did not respond. |
EFI_NOT_FOUND | The file was not found. |
EFI_ABORTED | The file load process was manually cancelled. |
EFI_BUFFER_TOO_SMALL | The BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request. |
Definition at line 666 of file HttpBootImpl.c.
EFI_STATUS HttpBootGetBootFileCaller | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN OUT UINTN * | BufferSize, | ||
IN VOID *Buffer | OPTIONAL, | ||
OUT HTTP_BOOT_IMAGE_TYPE * | ImageType | ||
) |
Issue calls to HttpBootGetBootFile() based on current Boot File State
[in] | Private | The pointer to the driver's private data. |
[in,out] | BufferSize | On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file. |
[in] | Buffer | The memory buffer to transfer the file to. If Buffer is NULL, then the size of the requested file is returned in BufferSize. |
[out] | ImageType | The image type of the downloaded file. |
EFI_SUCCESS | The file was loaded. |
EFI_INVALID_PARAMETER | BufferSize is NULL or Buffer Size is not NULL but Buffer is NULL. |
EFI_OUT_OF_RESOURCES | Could not allocate needed resources |
EFI_BUFFER_TOO_SMALL | The BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request. |
EFI_ACCESS_DENIED | Server authentication failed. |
Others | Unexpected error happened. |
Definition at line 306 of file HttpBootImpl.c.
EFI_STATUS HttpBootInstallCallback | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Install HTTP Boot Callback Protocol if not installed before.
[in] | Private | Pointer to HTTP Boot private data. |
EFI_SUCCESS | HTTP Boot Callback Protocol installed successfully. |
Others | Failed to install HTTP Boot Callback Protocol. |
Definition at line 22 of file HttpBootImpl.c.
EFI_STATUS HttpBootLoadFile | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN OUT UINTN * | BufferSize, | ||
IN VOID *Buffer | OPTIONAL, | ||
OUT HTTP_BOOT_IMAGE_TYPE * | ImageType | ||
) |
Attempt to download the boot file through HTTP message exchange.
[in] | Private | The pointer to the driver's private data. |
[in,out] | BufferSize | On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file. |
[in] | Buffer | The memory buffer to transfer the file to. If Buffer is NULL, then the size of the requested file is returned in BufferSize. |
[out] | ImageType | The image type of the downloaded file. |
EFI_SUCCESS | Boot file was loaded successfully. |
EFI_INVALID_PARAMETER | Private is NULL, or ImageType is NULL, or BufferSize is NULL. |
EFI_INVALID_PARAMETER | *BufferSize is not zero, and Buffer is NULL. |
EFI_NOT_STARTED | The driver is in stopped state. |
EFI_BUFFER_TOO_SMALL | The BufferSize is too small to read the boot file. BufferSize has been updated with the size needed to complete the request. |
EFI_DEVICE_ERROR | An unexpected network error occurred. |
Others | Other errors as indicated. |
Definition at line 451 of file HttpBootImpl.c.
EFI_STATUS HttpBootStart | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private, |
IN BOOLEAN | UsingIpv6, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath | ||
) |
Enable the use of UEFI HTTP boot function.
If the driver has already been started but not satisfy the requirement (IP stack and specified boot file path), this function will stop the driver and start it again.
[in] | Private | The pointer to the driver's private data. |
[in] | UsingIpv6 | Specifies the type of IP addresses that are to be used during the session that is being started. Set to TRUE for IPv6, and FALSE for IPv4. |
[in] | FilePath | The device specific path of the file to load. |
EFI_SUCCESS | HTTP boot was successfully enabled. |
EFI_INVALID_PARAMETER | Private is NULL or FilePath is NULL. |
EFI_INVALID_PARAMETER | The FilePath doesn't contain a valid URI device path node. |
EFI_ALREADY_STARTED | The driver is already in started state. |
EFI_OUT_OF_RESOURCES | There are not enough resources. |
Definition at line 118 of file HttpBootImpl.c.
EFI_STATUS HttpBootStop | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Disable the use of UEFI HTTP boot function.
[in] | Private | The pointer to the driver's private data. |
EFI_SUCCESS | HTTP boot was successfully disabled. |
EFI_NOT_STARTED | The driver is already in stopped state. |
EFI_INVALID_PARAMETER | Private is NULL. |
Others | Unexpected error when stop the function. |
Definition at line 539 of file HttpBootImpl.c.
VOID HttpBootUninstallCallback | ( | IN HTTP_BOOT_PRIVATE_DATA * | Private | ) |
Uninstall HTTP Boot Callback Protocol if it's installed by this driver.
[in] | Private | Pointer to HTTP Boot private data. |
Definition at line 76 of file HttpBootImpl.c.
GLOBAL_REMOVE_IF_UNREFERENCED EFI_HTTP_BOOT_CALLBACK_PROTOCOL gHttpBootDxeHttpBootCallback |
HTTP Boot Callback Protocol instance
Definition at line 907 of file HttpBootImpl.c.
GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile |
Load File Protocol instance
Definition at line 759 of file HttpBootImpl.c.