summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe/HttpBootDxe.h
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2017-06-14 17:28:48 +0800
committerFu Siyuan <siyuan.fu@intel.com>2017-06-22 10:56:25 +0800
commit95b5c32fb3d6bf677d4cb6471d6c683939014c89 (patch)
tree137594a6db98505b14d74eecb46c22376a0be4c1 /NetworkPkg/HttpBootDxe/HttpBootDxe.h
parenta77d109ffa0df3662999598e09e3c1e5fd7a1bfb (diff)
downloadedk2-95b5c32fb3d6bf677d4cb6471d6c683939014c89.tar.gz
edk2-95b5c32fb3d6bf677d4cb6471d6c683939014c89.tar.bz2
edk2-95b5c32fb3d6bf677d4cb6471d6c683939014c89.zip
NetworkPkg/HttpBootDxe: Add HTTP Boot Callback protocol support.
This patch updates the HTTP Boot driver to install a default HTTP Callback protocol if the platform doesn't provide one. This callback implementation will print the boot file download progress in percentage format. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/HttpBootDxe/HttpBootDxe.h')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDxe.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.h b/NetworkPkg/HttpBootDxe/HttpBootDxe.h
index a1e6792514..8d89b3e95c 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDxe.h
+++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.h
@@ -62,6 +62,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// Produced Protocols
//
#include <Protocol/LoadFile.h>
+#include <Protocol/HttpBootCallback.h>
//
// Consumed Guids
@@ -133,6 +134,14 @@ struct _HTTP_BOOT_VIRTUAL_NIC {
CallbackInfo, \
HTTP_BOOT_PRIVATE_DATA_SIGNATURE \
)
+
+#define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_PROTOCOL(CallbackProtocol) \
+ CR ( \
+ CallbackProtocol, \
+ HTTP_BOOT_PRIVATE_DATA, \
+ LoadFileCallback, \
+ HTTP_BOOT_PRIVATE_DATA_SIGNATURE \
+ )
struct _HTTP_BOOT_PRIVATE_DATA {
UINT32 Signature;
@@ -168,6 +177,11 @@ struct _HTTP_BOOT_PRIVATE_DATA {
EFI_LOAD_FILE_PROTOCOL LoadFile;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINT32 Id;
+ EFI_HTTP_BOOT_CALLBACK_PROTOCOL *HttpBootCallback;
+ EFI_HTTP_BOOT_CALLBACK_PROTOCOL LoadFileCallback;
+ UINT64 FileSize;
+ UINT64 ReceivedSize;
+ UINT32 Percentage;
//
// HII callback info block