From: Fu Siyuan <siyuan.fu@intel.com>
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting.ye@intel.com>, Wu Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 1/2] MdePkg: Add header file for HTTP Boot Callback protocol in UEFI 2.7.
Date: Wed, 14 Jun 2017 17:36:41 +0800 [thread overview]
Message-ID: <20170614093642.2240-2-siyuan.fu@intel.com> (raw)
In-Reply-To: <20170614093642.2240-1-siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
---
MdePkg/Include/Protocol/HttpBootCallback.h | 100 +++++++++++++++++++++++++++++
MdePkg/MdePkg.dec | 7 +-
2 files changed, 105 insertions(+), 2 deletions(-)
create mode 100644 MdePkg/Include/Protocol/HttpBootCallback.h
diff --git a/MdePkg/Include/Protocol/HttpBootCallback.h b/MdePkg/Include/Protocol/HttpBootCallback.h
new file mode 100644
index 0000000000..7542b30e03
--- /dev/null
+++ b/MdePkg/Include/Protocol/HttpBootCallback.h
@@ -0,0 +1,100 @@
+/** @file
+ This file defines the EFI HTTP Boot Callback Protocol interface.
+
+ Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.7
+
+**/
+
+#ifndef __EFI_HTTP_BOOT_CALLBACK_H__
+#define __EFI_HTTP_BOOT_CALLBACK_H__
+
+#define EFI_HTTP_BOOT_CALLBACK_PROTOCOL_GUID \
+ { \
+ 0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99} \
+ }
+
+typedef struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL EFI_HTTP_BOOT_CALLBACK_PROTOCOL;
+
+///
+/// EFI_HTTP_BOOT_CALLBACK_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// Data points to a DHCP4 packet which is about to transmit or has received.
+ ///
+ HttpBootDhcp4,
+ ///
+ /// Data points to a DHCP6 packet which is about to be transmit or has received.
+ ///
+ HttpBootDhcp6,
+ ///
+ /// Data points to an EFI_HTTP_MESSAGE structure, whichcontians a HTTP request message
+ /// to be transmitted.
+ ///
+ HttpBootHttpRequest,
+ ///
+ /// Data points to an EFI_HTTP_MESSAGE structure, which contians a received HTTP
+ /// response message.
+ ///
+ HttpBootHttpResponse,
+ ///
+ /// Part of the entity body has been received from the HTTP server. Data points to the
+ /// buffer of the entity body data.
+ ///
+ HttpBootHttpEntityBody,
+ HttpBootTypeMax
+} EFI_HTTP_BOOT_CALLBACK_DATA_TYPE;
+
+/**
+ 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.
+
+ @param[in] This Pointer to the EFI_HTTP_BOOT_CALLBACK_PROTOCOL instance.
+ @param[in] DataType The event that occurs in the current state.
+ @param[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.
+ @param[in] DataLength The length in bytes of the buffer pointed to by Data.
+ @param[in] Data A pointer to the buffer of data, the data type is specified by
+ DataType.
+
+ @retval EFI_SUCCESS Tells the HTTP Boot driver to continue the HTTP Boot process.
+ @retval EFI_ABORTED Tells the HTTP Boot driver to abort the current HTTP Boot process.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EFI_HTTP_BOOT_CALLBACK) (
+ 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
+ );
+
+///
+/// EFI HTTP Boot Callback Protocol is invoked when the HTTP Boot driver is about to transmit or
+/// has received a packet. The EFI HTTP Boot Callback Protocol must be installed on the same handle
+/// as the Load File Protocol for the HTTP Boot.
+///
+struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL {
+ EFI_HTTP_BOOT_CALLBACK Callback;
+};
+
+extern EFI_GUID gEfiHttpBootCallbackProtocolGuid;
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 7a7504b7a3..a55e8ce1d9 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2,7 +2,7 @@
# This Package provides all definitions, library classes and libraries instances.
#
# It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
-# EFI1.10/UEFI2.6/PI1.4 and some Industry Standards.
+# EFI1.10/UEFI2.7/PI1.4 and some Industry Standards.
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
@@ -1671,6 +1671,9 @@
## Include/Protocol/BluetoothLeConfig.h
gEfiBluetoothLeConfigProtocolGuid = { 0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } }
+ ## Include/Protocol/HttpBootCallback.h
+ gEfiHttpBootCallbackProtocolGuid = {0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99}}
+
#
# Protocols defined in Shell2.0
#
@@ -1685,7 +1688,7 @@
#
## Include/Protocol/ShellDynamicCommand.h
gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4, {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
-
+
#
# [Error.gEfiMdePkgTokenSpaceGuid]
# 0x80000001 | Invalid value provided.
--
2.13.0.windows.1
next prev parent reply other threads:[~2017-06-14 9:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 9:36 [Patch 0/2] Add HTTP Boot Callback Protocol support Fu Siyuan
2017-06-14 9:36 ` Fu Siyuan [this message]
2017-06-15 7:59 ` [Patch 1/2] MdePkg: Add header file for HTTP Boot Callback protocol in UEFI 2.7 Wu, Jiaxin
2017-06-14 9:36 ` [Patch 2/2] NetworkPkg/HttpBootDxe: Add HTTP Boot Callback protocol support Fu Siyuan
2017-06-15 7:59 ` Wu, Jiaxin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170614093642.2240-2-siyuan.fu@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox