NetworkPkg: Add URI configuration form to HTTP boot driver.

This patch updates the HTTP boot driver to produce a setup page for the boot
file URI configuration. A new boot option will be created for the manual
configured URI address. This change is made to support the HTTP boot usage
in home environment.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Fu Siyuan
2016-02-15 13:55:11 +08:00
parent 9353c60cea
commit fa848a4048
17 changed files with 1288 additions and 110 deletions

View File

@@ -1,7 +1,7 @@
/** @file
UEFI HTTP boot driver's private data structure and interfaces declaration.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
@@ -24,6 +24,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// Libraries
//
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiHiiServicesLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseLib.h>
#include <Library/UefiLib.h>
@@ -31,6 +33,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DebugLib.h>
#include <Library/NetLib.h>
#include <Library/HttpLib.h>
#include <Library/HiiLib.h>
#include <Library/PrintLib.h>
//
// UEFI Driver Model Protocols
@@ -42,6 +46,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Consumed Protocols
//
#include <Protocol/ServiceBinding.h>
#include <Protocol/HiiConfigAccess.h>
#include <Protocol/NetworkInterfaceIdentifier.h>
#include <Protocol/Dhcp4.h>
#include <Protocol/Dhcp6.h>
@@ -54,6 +60,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
#include <Protocol/LoadFile.h>
//
// Consumed Guids
//
#include <Guid/HttpBootConfigHii.h>
//
// Driver Version
//
@@ -81,6 +92,7 @@ typedef struct _HTTP_BOOT_VIRTUAL_NIC HTTP_BOOT_VIRTUAL_NIC;
#include "HttpBootImpl.h"
#include "HttpBootSupport.h"
#include "HttpBootClient.h"
#include "HttpBootConfig.h"
typedef union {
HTTP_BOOT_DHCP4_PACKET_CACHE Dhcp4;
@@ -95,6 +107,14 @@ struct _HTTP_BOOT_VIRTUAL_NIC {
HTTP_BOOT_PRIVATE_DATA *Private;
};
#define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO(Callback) \
CR ( \
Callback, \
HTTP_BOOT_PRIVATE_DATA, \
CallbackInfo, \
HTTP_BOOT_PRIVATE_DATA_SIGNATURE \
)
struct _HTTP_BOOT_PRIVATE_DATA {
UINT32 Signature;
EFI_HANDLE Controller;
@@ -131,6 +151,11 @@ struct _HTTP_BOOT_PRIVATE_DATA {
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINT32 Id;
//
// HII callback info block
//
HTTP_BOOT_FORM_CALLBACK_INFO CallbackInfo;
//
// Mode data
//
@@ -146,6 +171,12 @@ struct _HTTP_BOOT_PRIVATE_DATA {
UINTN BootFileSize;
BOOLEAN NoGateway;
//
// URI string extracted from the input FilePath parameter.
//
CHAR8 *FilePathUri;
VOID *FilePathUriParser;
//
// Cached HTTP data
//