]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootConfig.c
MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBoot
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootConfig.c
index 81fceb2fd6bd8e0f6fc9094935c7033a5ee37f2f..b95abc624b4efa124bb9f058f3d9dab9ff21adc7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper functions for configuring or getting the parameters relating to HTTP Boot.\r
 \r
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2018, 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
@@ -24,7 +24,7 @@ CHAR16  mHttpBootConfigStorageName[]     = L"HTTP_BOOT_CONFIG_IFR_NVDATA";
   @param[in]  UsingIpv6           Set to TRUE if creating boot option for IPv6.\r
   @param[in]  Description         The description text of the boot option.\r
   @param[in]  Uri                 The URI string of the boot file.\r
-  \r
+\r
   @retval EFI_SUCCESS             The boot option is created successfully.\r
   @retval Others                  Failed to create new boot option.\r
 \r
@@ -72,7 +72,7 @@ HttpBootAddBootOption (
   if ((StrLen (Uri) != 0) && (StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 8) != 0)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Create a new device path by appending the IP node and URI node to\r
   // the driver's parent device path\r
@@ -154,7 +154,7 @@ ON_EXIT:
 }\r
 \r
 /**\r
-   \r
+\r
   This function allows the caller to request the current\r
   configuration for one or more named elements. The resulting\r
   string is in <ConfigAltResp> format. Also, any and all alternative\r
@@ -183,7 +183,7 @@ ON_EXIT:
                          to the most recent "&" before the first\r
                          failing name / value pair (or the beginning\r
                          of the string if the failure is in the first\r
-                         name / value pair) if the request was not successful.                        \r
+                         name / value pair) if the request was not successful.\r
 \r
   @param[out] Results    A null-terminated Unicode string in\r
                          <ConfigAltResp> format which has all values\r
@@ -204,7 +204,7 @@ ON_EXIT:
                                   would result in this type of\r
                                   error. In this case, the\r
                                   Progress parameter would be\r
-                                  set to NULL. \r
+                                  set to NULL.\r
 \r
   @retval EFI_NOT_FOUND           Routing data doesn't match any\r
                                   known driver. Progress set to the\r
@@ -249,7 +249,7 @@ HttpBootFormExtractConfig (
   if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &gHttpBootConfigGuid, mHttpBootConfigStorageName)) {\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
+\r
   ConfigRequestHdr = NULL;\r
   ConfigRequest    = NULL;\r
   AllocatedRequest = FALSE;\r
@@ -289,7 +289,7 @@ HttpBootFormExtractConfig (
                                 Results,\r
                                 Progress\r
                                 );\r
-  \r
+\r
   //\r
   // Free the allocated config request string.\r
   //\r
@@ -310,7 +310,7 @@ HttpBootFormExtractConfig (
 }\r
 \r
 /**\r
-   \r
+\r
   This function applies changes in a driver's configuration.\r
   Input is a Configuration, which has the routing data for this\r
   driver followed by name / value configuration pairs. The driver\r
@@ -323,8 +323,8 @@ HttpBootFormExtractConfig (
   @param[in]  This           Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
 \r
   @param[in]  Configuration  A null-terminated Unicode string in\r
-                             <ConfigString> format. \r
-  \r
+                             <ConfigString> format.\r
+\r
   @param[out] Progress       A pointer to a string filled in with the\r
                              offset of the most recent '&' before the\r
                              first failing name / value pair (or the\r
@@ -335,16 +335,16 @@ HttpBootFormExtractConfig (
 \r
   @retval EFI_SUCCESS             The results have been distributed or are\r
                                   awaiting distribution.\r
-  \r
+\r
   @retval EFI_OUT_OF_RESOURCES    Not enough memory to store the\r
                                   parts of the results that must be\r
                                   stored awaiting possible future\r
                                   protocols.\r
-  \r
+\r
   @retval EFI_INVALID_PARAMETERS  Passing in a NULL for the\r
                                   Results parameter would result\r
                                   in this type of error.\r
-  \r
+\r
   @retval EFI_NOT_FOUND           Target for the specified routing data\r
                                   was not found.\r
 \r
@@ -381,7 +381,7 @@ HttpBootFormRouteConfig (
 \r
   CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);\r
   Private      = HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO (CallbackInfo);\r
-  \r
+\r
   BufferSize = sizeof (HTTP_BOOT_CONFIG_IFR_NVDATA);\r
   ZeroMem (&CallbackInfo->HttpBootNvData, BufferSize);\r
 \r
@@ -405,12 +405,12 @@ HttpBootFormRouteConfig (
     CallbackInfo->HttpBootNvData.Description,\r
     CallbackInfo->HttpBootNvData.Uri\r
     );\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
-   \r
+\r
   This function is called to provide results data to the driver.\r
   This data consists of a unique key that is used to identify\r
   which data is either being passed back or being asked for.\r
@@ -419,7 +419,7 @@ HttpBootFormRouteConfig (
   @param[in]       Action        Specifies the type of action taken by the browser.\r
   @param[in]       QuestionId    A unique value which is sent to the original\r
                                  exporting driver so that it can identify the type\r
-                                 of data to expect. The format of the data tends to \r
+                                 of data to expect. The format of the data tends to\r
                                  vary based on the opcode that generated the callback.\r
   @param[in]       Type          The type of value for the question.\r
   @param[in, out]  Value         A pointer to the data being sent to the original\r
@@ -456,17 +456,17 @@ HttpBootFormCallback (
   UriLen   = 0;\r
   AsciiUri = NULL;\r
   Status   = EFI_SUCCESS;\r
-  \r
+\r
   if (This == NULL || Value == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
   CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);\r
-  \r
+\r
   if (Action != EFI_BROWSER_ACTION_CHANGING) {\r
     return EFI_UNSUPPORTED;\r
   }\r
-  \r
+\r
   switch (QuestionId) {\r
   case KEY_INITIATOR_URI:\r
     //\r
@@ -474,8 +474,8 @@ HttpBootFormCallback (
     //\r
     Uri = HiiGetString (CallbackInfo->RegisteredHandle, Value->string, NULL);\r
     if(Uri == NULL) {\r
-       return EFI_INVALID_PARAMETER;\r
-    }        \r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
 \r
     //\r
     // The URI should be either an empty string (for corporate environment) ,or http(s) for home environment.\r
@@ -492,7 +492,7 @@ HttpBootFormCallback (
       UnicodeStrToAsciiStrS (Uri, AsciiUri, UriLen);\r
 \r
       Status = HttpBootCheckUriScheme (AsciiUri);\r
-      \r
+\r
       if (Status == EFI_INVALID_PARAMETER) {\r
 \r
         DEBUG ((EFI_D_ERROR, "HttpBootFormCallback: %r.\n", Status));\r
@@ -503,11 +503,11 @@ HttpBootFormCallback (
           L"ERROR: Unsupported URI!",\r
           L"Only supports HTTP and HTTPS",\r
           NULL\r
-          ); \r
+          );\r
       } else if (Status == EFI_ACCESS_DENIED) {\r
-      \r
+\r
         DEBUG ((EFI_D_ERROR, "HttpBootFormCallback: %r.\n", Status));\r
-      \r
+\r
         CreatePopUp (\r
           EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
           &Key,\r
@@ -524,8 +524,8 @@ HttpBootFormCallback (
 \r
     if (AsciiUri != NULL) {\r
       FreePool (AsciiUri);\r
-    }   \r
-    \r
+    }\r
+\r
     break;\r
 \r
   default:\r
@@ -561,7 +561,7 @@ HttpBootConfigFormInit (
   if (CallbackInfo->Initilized) {\r
     return EFI_SUCCESS;\r
   }\r
-  \r
+\r
   CallbackInfo->Signature = HTTP_BOOT_FORM_CALLBACK_INFO_SIGNATURE;\r
 \r
   //\r
@@ -586,7 +586,7 @@ HttpBootConfigFormInit (
   CallbackInfo->ConfigAccess.ExtractConfig = HttpBootFormExtractConfig;\r
   CallbackInfo->ConfigAccess.RouteConfig   = HttpBootFormRouteConfig;\r
   CallbackInfo->ConfigAccess.Callback      = HttpBootFormCallback;\r
-  \r
+\r
   //\r
   // Install Device Path Protocol and Config Access protocol to driver handle.\r
   //\r
@@ -623,25 +623,25 @@ HttpBootConfigFormInit (
   Status = NetLibGetMacString (Private->Controller, NULL, &MacString);\r
   if (!EFI_ERROR (Status)) {\r
     OldMenuString = HiiGetString (\r
-                      CallbackInfo->RegisteredHandle, \r
-                      STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP), \r
+                      CallbackInfo->RegisteredHandle,\r
+                      STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP),\r
                       NULL\r
                       );\r
     UnicodeSPrint (MenuString, 128, L"%s (MAC:%s)", OldMenuString, MacString);\r
     HiiSetString (\r
-      CallbackInfo->RegisteredHandle, \r
-      STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP), \r
-      MenuString, \r
+      CallbackInfo->RegisteredHandle,\r
+      STRING_TOKEN (STR_HTTP_BOOT_CONFIG_FORM_HELP),\r
+      MenuString,\r
       NULL\r
       );\r
-    \r
+\r
     FreePool (MacString);\r
     FreePool (OldMenuString);\r
 \r
     CallbackInfo->Initilized = TRUE;\r
     return EFI_SUCCESS;\r
   }\r
-  \r
+\r
 Error:\r
 \r
   HttpBootConfigFormUnload (Private);\r