]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add header file for HTTP Boot Callback protocol in UEFI 2.7.
authorFu Siyuan <siyuan.fu@intel.com>
Wed, 14 Jun 2017 09:25:39 +0000 (17:25 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Thu, 22 Jun 2017 02:56:08 +0000 (10:56 +0800)
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>
MdePkg/Include/Protocol/HttpBootCallback.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/HttpBootCallback.h b/MdePkg/Include/Protocol/HttpBootCallback.h
new file mode 100644 (file)
index 0000000..7542b30
--- /dev/null
@@ -0,0 +1,100 @@
+/** @file\r
+  This file defines the EFI HTTP Boot Callback Protocol interface.\r
+\r
+  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution. The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  @par Revision Reference:\r
+  This Protocol is introduced in UEFI Specification 2.7\r
+\r
+**/\r
+\r
+#ifndef __EFI_HTTP_BOOT_CALLBACK_H__\r
+#define __EFI_HTTP_BOOT_CALLBACK_H__\r
+\r
+#define EFI_HTTP_BOOT_CALLBACK_PROTOCOL_GUID \\r
+  { \\r
+    0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99} \\r
+  }\r
+\r
+typedef struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL  EFI_HTTP_BOOT_CALLBACK_PROTOCOL;\r
+\r
+///\r
+/// EFI_HTTP_BOOT_CALLBACK_DATA_TYPE\r
+///\r
+typedef enum {\r
+  ///\r
+  /// Data points to a DHCP4 packet which is about to transmit or has received.\r
+  ///\r
+  HttpBootDhcp4,\r
+  ///\r
+  /// Data points to a DHCP6 packet which is about to be transmit or has received.\r
+  ///\r
+  HttpBootDhcp6,\r
+  ///\r
+  /// Data points to an EFI_HTTP_MESSAGE structure, whichcontians a HTTP request message\r
+  /// to be transmitted.\r
+  ///\r
+  HttpBootHttpRequest,\r
+  ///\r
+  /// Data points to an EFI_HTTP_MESSAGE structure, which contians a received HTTP \r
+  /// response message.\r
+  ///\r
+  HttpBootHttpResponse,\r
+  ///\r
+  /// Part of the entity body has been received from the HTTP server. Data points to the\r
+  /// buffer of the entity body data.\r
+  ///\r
+  HttpBootHttpEntityBody,\r
+  HttpBootTypeMax\r
+} EFI_HTTP_BOOT_CALLBACK_DATA_TYPE;\r
+\r
+/**\r
+  Callback function that is invoked when the HTTP Boot driver is about to transmit or has received a\r
+  packet.\r
+\r
+  This function is invoked when the HTTP Boot driver is about to transmit or has received packet.\r
+  Parameters DataType and Received specify the type of event and the format of the buffer pointed\r
+  to by Data. Due to the polling nature of UEFI device drivers, this callback function should not\r
+  execute for more than 5 ms.\r
+  The returned status code determines the behavior of the HTTP Boot driver.\r
+\r
+  @param[in]  This                Pointer to the EFI_HTTP_BOOT_CALLBACK_PROTOCOL instance.\r
+  @param[in]  DataType            The event that occurs in the current state.\r
+  @param[in]  Received            TRUE if the callback is being invoked due to a receive event.\r
+                                  FALSE if the callback is being invoked due to a transmit event.\r
+  @param[in]  DataLength          The length in bytes of the buffer pointed to by Data.\r
+  @param[in]  Data                A pointer to the buffer of data, the data type is specified by\r
+                                  DataType.\r
+                                  \r
+  @retval EFI_SUCCESS             Tells the HTTP Boot driver to continue the HTTP Boot process.\r
+  @retval EFI_ABORTED             Tells the HTTP Boot driver to abort the current HTTP Boot process.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * EFI_HTTP_BOOT_CALLBACK) (\r
+  IN EFI_HTTP_BOOT_CALLBACK_PROTOCOL    *This,\r
+  IN EFI_HTTP_BOOT_CALLBACK_DATA_TYPE   DataType,\r
+  IN BOOLEAN                            Received,\r
+  IN UINT32                             DataLength,\r
+  IN VOID                               *Data   OPTIONAL\r
+ );\r
+\r
+///\r
+/// EFI HTTP Boot Callback Protocol is invoked when the HTTP Boot driver is about to transmit or \r
+/// has received a packet. The EFI HTTP Boot Callback Protocol must be installed on the same handle\r
+/// as the Load File Protocol for the HTTP Boot.\r
+///\r
+struct _EFI_HTTP_BOOT_CALLBACK_PROTOCOL {\r
+  EFI_HTTP_BOOT_CALLBACK Callback;\r
+};\r
+\r
+extern EFI_GUID gEfiHttpBootCallbackProtocolGuid;\r
+\r
+#endif\r
index 74e1fbcdcdb5e76b9a51e6fda605b336e5e1072b..4abbbd88886772f0528c3d23c9d19ce93986f7bf 100644 (file)
@@ -2,7 +2,7 @@
 # This Package provides all definitions, library classes and libraries instances.\r
 #\r
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of\r
 # This Package provides all definitions, library classes and libraries instances.\r
 #\r
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of\r
-# EFI1.10/UEFI2.6/PI1.4 and some Industry Standards.\r
+# EFI1.10/UEFI2.7/PI1.4 and some Industry Standards.\r
 #\r
 # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #\r
 # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
   ## Include/Protocol/UfsDeviceConfig.h\r
   gEfiUfsDeviceConfigProtocolGuid           = { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }}\r
 \r
   ## Include/Protocol/UfsDeviceConfig.h\r
   gEfiUfsDeviceConfigProtocolGuid           = { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }}\r
 \r
+  ## Include/Protocol/HttpBootCallback.h\r
+  gEfiHttpBootCallbackProtocolGuid   = {0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99}}\r
+\r
   #\r
   # Protocols defined in Shell2.0\r
   #\r
   #\r
   # Protocols defined in Shell2.0\r
   #\r