]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootDxe.h
MdeModulePkg/UefiBootManagerLib: Generate boot description for NVME
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootDxe.h
index 452c8f4906db386ea896301a869d2cef01b9a93e..a1e67925145e8128ebef5e741bceffff6b2ff1a2 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   UEFI HTTP boot driver's private data structure and interfaces declaration.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -17,10 +18,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Uefi.h>\r
 \r
+#include <IndustryStandard/Http11.h>\r
+#include <IndustryStandard/Dhcp.h>\r
+\r
 //\r
 // Libraries\r
 //\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/UefiLib.h>\r
@@ -28,6 +34,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/DebugLib.h>\r
 #include <Library/NetLib.h>\r
 #include <Library/HttpLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/DpcLib.h>\r
 \r
 //\r
 // UEFI Driver Model Protocols\r
@@ -39,6 +48,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Consumed Protocols\r
 //\r
+#include <Protocol/ServiceBinding.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
 #include <Protocol/NetworkInterfaceIdentifier.h>\r
 #include <Protocol/Dhcp4.h>\r
 #include <Protocol/Dhcp6.h>\r
@@ -46,16 +57,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/Http.h>\r
 #include <Protocol/Ip4Config2.h>\r
 #include <Protocol/Ip6Config.h>\r
+#include <Protocol/RamDisk.h>\r
 //\r
 // Produced Protocols\r
 //\r
 #include <Protocol/LoadFile.h>\r
 \r
+//\r
+// Consumed Guids\r
+//\r
+#include <Guid/HttpBootConfigHii.h>\r
+\r
 //\r
 // Driver Version\r
 //\r
 #define HTTP_BOOT_DXE_VERSION  0xa\r
 \r
+//\r
+// Standard Media Types defined in \r
+// http://www.iana.org/assignments/media-types\r
+//\r
+#define HTTP_CONTENT_TYPE_APP_EFI           "application/efi"\r
+#define HTTP_CONTENT_TYPE_APP_IMG           "application/vnd.efi-img"\r
+#define HTTP_CONTENT_TYPE_APP_ISO           "application/vnd.efi-iso"\r
+\r
 //\r
 // Protocol instances\r
 //\r
@@ -69,6 +94,13 @@ extern EFI_COMPONENT_NAME_PROTOCOL  gHttpBootDxeComponentName;
 typedef struct _HTTP_BOOT_PRIVATE_DATA      HTTP_BOOT_PRIVATE_DATA;\r
 typedef struct _HTTP_BOOT_VIRTUAL_NIC       HTTP_BOOT_VIRTUAL_NIC;\r
 \r
+typedef enum  {\r
+  ImageTypeEfi,\r
+  ImageTypeVirtualCd,\r
+  ImageTypeVirtualDisk,\r
+  ImageTypeMax\r
+} HTTP_BOOT_IMAGE_TYPE;\r
+\r
 //\r
 // Include files with internal function prototypes\r
 //\r
@@ -78,6 +110,7 @@ typedef struct _HTTP_BOOT_VIRTUAL_NIC       HTTP_BOOT_VIRTUAL_NIC;
 #include "HttpBootImpl.h"\r
 #include "HttpBootSupport.h"\r
 #include "HttpBootClient.h"\r
+#include "HttpBootConfig.h"\r
 \r
 typedef union {\r
   HTTP_BOOT_DHCP4_PACKET_CACHE              Dhcp4;\r
@@ -87,15 +120,23 @@ typedef union {
 struct _HTTP_BOOT_VIRTUAL_NIC {\r
   UINT32                                    Signature;\r
   EFI_HANDLE                                Controller;\r
+  EFI_HANDLE                                ImageHandle;\r
   EFI_LOAD_FILE_PROTOCOL                    LoadFile;\r
   EFI_DEVICE_PATH_PROTOCOL                  *DevicePath;\r
   HTTP_BOOT_PRIVATE_DATA                    *Private;\r
 };\r
 \r
+#define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO(Callback) \\r
+  CR ( \\r
+  Callback, \\r
+  HTTP_BOOT_PRIVATE_DATA, \\r
+  CallbackInfo, \\r
+  HTTP_BOOT_PRIVATE_DATA_SIGNATURE \\r
+  )\r
+\r
 struct _HTTP_BOOT_PRIVATE_DATA {\r
   UINT32                                    Signature;\r
   EFI_HANDLE                                Controller;\r
-  EFI_HANDLE                                Image;\r
 \r
   HTTP_BOOT_VIRTUAL_NIC                     *Ip4Nic;\r
   HTTP_BOOT_VIRTUAL_NIC                     *Ip6Nic;\r
@@ -128,6 +169,11 @@ struct _HTTP_BOOT_PRIVATE_DATA {
   EFI_DEVICE_PATH_PROTOCOL                  *DevicePath;\r
   UINT32                                    Id;\r
 \r
+  //\r
+  // HII callback info block\r
+  //\r
+  HTTP_BOOT_FORM_CALLBACK_INFO              CallbackInfo;\r
+\r
   //\r
   // Mode data\r
   //\r
@@ -138,10 +184,22 @@ struct _HTTP_BOOT_PRIVATE_DATA {
   EFI_IP_ADDRESS                            GatewayIp;\r
   EFI_IP_ADDRESS                            ServerIp;\r
   UINT16                                    Port;\r
+\r
+  //\r
+  // The URI string attempt to download through HTTP, may point to\r
+  // the memory in cached DHCP offer, or to the memory in FilePathUri.\r
+  //\r
   CHAR8                                     *BootFileUri;\r
   VOID                                      *BootFileUriParser;\r
   UINTN                                     BootFileSize;\r
   BOOLEAN                                   NoGateway;\r
+  HTTP_BOOT_IMAGE_TYPE                      ImageType;\r
+\r
+  //\r
+  // URI string extracted from the input FilePath parameter.\r
+  //\r
+  CHAR8                                     *FilePathUri;\r
+  VOID                                      *FilePathUriParser;\r
 \r
   //\r
   // Cached HTTP data\r