]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiConfig.c
index 9f795b9d8461e50b2a9ad77fc055f5e566ab0578..cb1eff1b690cc8494bc631e6f3e2c0497f64e992 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper functions for configuring or getting the parameters relating to iSCSI.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -14,7 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "IScsiImpl.h"\r
 \r
-EFI_GUID        mVendorGuid              = ISCSI_CONFIG_GUID;\r
 CHAR16          mVendorStorageName[]     = L"ISCSI_CONFIG_IFR_NVDATA";\r
 BOOLEAN         mIScsiDeviceListUpdated  = FALSE;\r
 UINTN           mNumberOfIScsiDevices    = 0;\r
@@ -35,15 +34,12 @@ HII_VENDOR_DEVICE_PATH  mIScsiHiiVendorDevicePath = {
         (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
       }\r
     },\r
-    //\r
-    // {49D7B73E-143D-4716-977B-C45F1CB038CC}\r
-    //\r
-    { 0x49d7b73e, 0x143d, 0x4716, { 0x97, 0x7b, 0xc4, 0x5f, 0x1c, 0xb0, 0x38, 0xcc } }\r
+    IP4_ISCSI_CONFIG_GUID\r
   },\r
   {\r
     END_DEVICE_PATH_TYPE,\r
     END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-    { \r
+    {\r
       (UINT8) (END_DEVICE_PATH_LENGTH),\r
       (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)\r
     }\r
@@ -98,7 +94,7 @@ IScsiParseIsIdFromString (
   if (StrLen (IsIdStr) != 6) {\r
     UnicodeSPrint (\r
       PortString,\r
-      (UINTN) ISCSI_NAME_IFR_MAX_SIZE,\r
+      (UINTN) sizeof (PortString),\r
       L"Error! Input is incorrect, please input 6 hex numbers!\n"\r
       );\r
 \r
@@ -184,7 +180,7 @@ IScsiConvertIsIdToString (
   Update the list of iSCSI devices the iSCSI driver is controlling.\r
 \r
   @retval EFI_SUCCESS            The callback successfully handled the action.\r
-  @retval Others                 Other errors as indicated.   \r
+  @retval Others                 Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiUpdateDeviceList (\r
@@ -224,17 +220,18 @@ IScsiUpdateDeviceList (
   DataSize = 0;\r
   Status = gRT->GetVariable (\r
                   L"iSCSIDeviceList",\r
-                  &mVendorGuid,\r
+                  &gIp4IScsiConfigGuid,\r
                   NULL,\r
                   &DataSize,\r
                   NULL\r
                   );\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     DeviceList = (ISCSI_DEVICE_LIST *) AllocatePool (DataSize);\r
+    ASSERT (DeviceList != NULL);\r
 \r
     gRT->GetVariable (\r
           L"iSCSIDeviceList",\r
-          &mVendorGuid,\r
+          &gIp4IScsiConfigGuid,\r
           NULL,\r
           &DataSize,\r
           DeviceList\r
@@ -282,7 +279,7 @@ IScsiUpdateDeviceList (
       CurMacInfo = &DeviceList->MacInfo[Index];\r
       IScsiMacAddrToStr (&CurMacInfo->Mac, CurMacInfo->Len, CurMacInfo->VlanId, MacString);\r
       gRT->SetVariable (MacString, &gEfiIScsiInitiatorNameProtocolGuid, 0, 0, NULL);\r
-      gRT->SetVariable (MacString, &mIScsiCHAPAuthInfoGuid, 0, 0, NULL);\r
+      gRT->SetVariable (MacString, &gIScsiCHAPAuthInfoGuid, 0, 0, NULL);\r
     }\r
 \r
     FreePool (DeviceList);\r
@@ -295,6 +292,7 @@ IScsiUpdateDeviceList (
   //\r
   DeviceListSize        = sizeof (ISCSI_DEVICE_LIST) + (NumHandles - 1) * sizeof (ISCSI_MAC_INFO);\r
   DeviceList            = (ISCSI_DEVICE_LIST *) AllocatePool (DeviceListSize);\r
+  ASSERT (DeviceList != NULL);\r
   DeviceList->NumDevice = (UINT8) NumHandles;\r
 \r
   for (Index = 0; Index < NumHandles; Index++) {\r
@@ -308,7 +306,7 @@ IScsiUpdateDeviceList (
 \r
   gRT->SetVariable (\r
         L"iSCSIDeviceList",\r
-        &mVendorGuid,\r
+        &gIp4IScsiConfigGuid,\r
         ISCSI_CONFIG_VAR_ATTR,\r
         DeviceListSize,\r
         DeviceList\r
@@ -447,7 +445,7 @@ IScsiConvertDeviceConfigDataToIfrNvData (
                                   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
   @retval EFI_NOT_FOUND           Routing data doesn't match any\r
                                   known driver. Progress set to the\r
                                   first character in the routing header.\r
@@ -488,7 +486,7 @@ IScsiFormExtractConfig (
   }\r
 \r
   *Progress = Request;\r
-  if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &mVendorGuid, mVendorStorageName)) {\r
+  if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &gIp4IScsiConfigGuid, mVendorStorageName)) {\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -532,7 +530,7 @@ IScsiFormExtractConfig (
     // Allocate and fill a buffer large enough to hold the <ConfigHdr> template\r
     // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator\r
     //\r
-    ConfigRequestHdr = HiiConstructConfigHdr (&mVendorGuid, mVendorStorageName, Private->DriverHandle);\r
+    ConfigRequestHdr = HiiConstructConfigHdr (&gIp4IScsiConfigGuid, mVendorStorageName, Private->DriverHandle);\r
     Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);\r
     ConfigRequest = AllocateZeroPool (Size);\r
     ASSERT (ConfigRequest != NULL);\r
@@ -581,7 +579,7 @@ IScsiFormExtractConfig (
 \r
   @param[in]  This           Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
   @param[in]  Configuration  A null-terminated Unicode string in\r
-                             <ConfigString> format.   \r
+                             <ConfigString> format.\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
@@ -591,7 +589,7 @@ IScsiFormExtractConfig (
                              successful.\r
 \r
   @retval EFI_SUCCESS             The results have been distributed or are\r
-                                  awaiting distribution.  \r
+                                  awaiting distribution.\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
@@ -618,7 +616,7 @@ IScsiFormRouteConfig (
   // Check routing data in <ConfigHdr>.\r
   // Note: if only one Storage is used, then this checking could be skipped.\r
   //\r
-  if (!HiiIsConfigHdrMatch (Configuration, &mVendorGuid, mVendorStorageName)) {\r
+  if (!HiiIsConfigHdrMatch (Configuration, &gIp4IScsiConfigGuid, mVendorStorageName)) {\r
     *Progress = Configuration;\r
     return EFI_NOT_FOUND;\r
   }\r
@@ -636,7 +634,7 @@ IScsiFormRouteConfig (
   @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 enerated the callback.\r
   @param[in]  Type               The type of value for the question.\r
   @param[in]  Value              A pointer to the data being sent to the original\r
@@ -650,8 +648,8 @@ IScsiFormRouteConfig (
   @retval EFI_DEVICE_ERROR       The variable could not be saved.\r
   @retval EFI_UNSUPPORTED        The specified Action is not supported by the\r
                                  callback.Currently not implemented.\r
-  @retval EFI_INVALID_PARAMETERS Passing in wrong parameter. \r
-  @retval Others                 Other errors as indicated. \r
+  @retval EFI_INVALID_PARAMETERS Passing in wrong parameter.\r
+  @retval Others                 Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -680,19 +678,39 @@ IScsiFormCallback (
   EFI_STATUS                Status;\r
   EFI_INPUT_KEY             Key;\r
 \r
+  if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  Private   = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);\r
+  //\r
+  // Retrieve uncommitted data from Browser\r
+  //\r
+  IfrNvData = AllocateZeroPool (sizeof (ISCSI_CONFIG_IFR_NVDATA));\r
+  ASSERT (IfrNvData != NULL);\r
+  if (!HiiGetBrowserData (&gIp4IScsiConfigGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData)) {\r
+    FreePool (IfrNvData);\r
+    return EFI_NOT_FOUND;\r
+  }\r
+  Status = EFI_SUCCESS;\r
+\r
   if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
-    Private   = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);\r
-    //\r
-    // Retrive uncommitted data from Browser\r
-    //\r
-    IfrNvData = AllocateZeroPool (sizeof (ISCSI_CONFIG_IFR_NVDATA));\r
-    ASSERT (IfrNvData != NULL);\r
-    if (!HiiGetBrowserData (&mVendorGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData)) {\r
-      FreePool (IfrNvData);\r
-      return EFI_NOT_FOUND;\r
-    }\r
-    Status = EFI_SUCCESS;\r
+    if ((QuestionId >= KEY_DEVICE_ENTRY_BASE) && (QuestionId < (mNumberOfIScsiDevices + KEY_DEVICE_ENTRY_BASE))) {\r
+      //\r
+      // In case goto the device configuration form, update the device form title.\r
+      //\r
+      ConfigFormEntry = IScsiGetConfigFormEntryByIndex ((UINT32) (QuestionId - KEY_DEVICE_ENTRY_BASE));\r
+      ASSERT (ConfigFormEntry != NULL);\r
+\r
+      UnicodeSPrint (PortString, (UINTN) sizeof (PortString), L"Port %s", ConfigFormEntry->MacString);\r
+      DeviceFormTitleToken = (EFI_STRING_ID) STR_ISCSI_DEVICE_FORM_TITLE;\r
+      HiiSetString (Private->RegisteredHandle, DeviceFormTitleToken, PortString, NULL);\r
+\r
+      IScsiConvertDeviceConfigDataToIfrNvData (ConfigFormEntry, IfrNvData);\r
 \r
+      Private->Current = ConfigFormEntry;\r
+    }\r
+  } else if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
     switch (QuestionId) {\r
     case KEY_INITIATOR_NAME:\r
       IScsiUnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);\r
@@ -703,12 +721,15 @@ IScsiFormCallback (
         CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid iSCSI Name!", NULL);\r
       }\r
 \r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
       break;\r
 \r
     case KEY_LOCAL_IP:\r
       IScsiUnicodeStrToAsciiStr (IfrNvData->LocalIp, Ip4String);\r
       Status = IScsiAsciiStrToIp (Ip4String, &HostIp.v4);\r
-      if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {\r
+      if (EFI_ERROR (Status) ||\r
+          ((Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&\r
+           !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), NTOHL(*(UINT32*)Private->Current->SessionConfigData.SubnetMask.Addr)))) {\r
         CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);\r
         Status = EFI_INVALID_PARAMETER;\r
       } else {\r
@@ -732,7 +753,10 @@ IScsiFormCallback (
     case KEY_GATE_WAY:\r
       IScsiUnicodeStrToAsciiStr (IfrNvData->Gateway, Ip4String);\r
       Status = IScsiAsciiStrToIp (Ip4String, &Gateway.v4);\r
-      if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {\r
+      if (EFI_ERROR (Status) ||\r
+          ((Gateway.Addr[0] != 0) &&\r
+           (Private->Current->SessionConfigData.SubnetMask.Addr[0] != 0) &&\r
+           !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), NTOHL(*(UINT32*)Private->Current->SessionConfigData.SubnetMask.Addr)))) {\r
         CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Gateway!", NULL);\r
         Status = EFI_INVALID_PARAMETER;\r
       } else {\r
@@ -744,7 +768,7 @@ IScsiFormCallback (
     case KEY_TARGET_IP:\r
       IScsiUnicodeStrToAsciiStr (IfrNvData->TargetIp, Ip4String);\r
       Status = IScsiAsciiStrToIp (Ip4String, &HostIp.v4);\r
-      if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {\r
+      if (EFI_ERROR (Status) || IP4_IS_LOCAL_BROADCAST (EFI_NTOHL(HostIp.v4)) || IP4_IS_UNSPECIFIED (EFI_NTOHL(HostIp.v4))) {\r
         CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);\r
         Status = EFI_INVALID_PARAMETER;\r
       } else {\r
@@ -759,7 +783,7 @@ IScsiFormCallback (
       if (EFI_ERROR (Status)) {\r
         CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid iSCSI Name!", NULL);\r
       } else {\r
-        AsciiStrCpy (Private->Current->SessionConfigData.TargetName, IScsiName);\r
+        AsciiStrCpyS (Private->Current->SessionConfigData.TargetName, ISCSI_NAME_MAX_SIZE, IScsiName);\r
       }\r
 \r
       break;\r
@@ -848,11 +872,28 @@ IScsiFormCallback (
         //\r
         if (!Private->Current->SessionConfigData.TargetInfoFromDhcp) {\r
           CopyMem (&HostIp.v4, &Private->Current->SessionConfigData.TargetIp, sizeof (HostIp.v4));\r
-          if (!NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {\r
+          if (IP4_IS_UNSPECIFIED (NTOHL (HostIp.Addr[0])) || IP4_IS_LOCAL_BROADCAST (NTOHL (HostIp.Addr[0]))) {\r
             CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Target IP is invalid!", NULL);\r
             Status = EFI_INVALID_PARAMETER;\r
             break;\r
           }\r
+\r
+          //\r
+          // Validate iSCSI target name configuration again:\r
+          // The format of iSCSI target name is already verified when user input the name;\r
+          // here we only check the case user does not input the name.\r
+          //\r
+          if (Private->Current->SessionConfigData.TargetName[0] == '\0') {\r
+            CreatePopUp (\r
+              EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+              &Key,\r
+              L"iSCSI target name is NULL!",\r
+              NULL\r
+              );\r
+            Status = EFI_INVALID_PARAMETER;\r
+            break;\r
+          }\r
+\r
         }\r
 \r
         if (IfrNvData->CHAPType != ISCSI_CHAP_NONE) {\r
@@ -884,50 +925,29 @@ IScsiFormCallback (
       BufferSize = sizeof (Private->Current->AuthConfigData);\r
       gRT->SetVariable (\r
             Private->Current->MacString,\r
-            &mIScsiCHAPAuthInfoGuid,\r
+            &gIScsiCHAPAuthInfoGuid,\r
             ISCSI_CONFIG_VAR_ATTR,\r
             BufferSize,\r
             &Private->Current->AuthConfigData\r
             );\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
       break;\r
 \r
     default:\r
-      if ((QuestionId >= KEY_DEVICE_ENTRY_BASE) && (QuestionId < (mNumberOfIScsiDevices + KEY_DEVICE_ENTRY_BASE))) {\r
-        //\r
-        // In case goto the device configuration form, update the device form title.\r
-        //\r
-        ConfigFormEntry = IScsiGetConfigFormEntryByIndex ((UINT32) (QuestionId - KEY_DEVICE_ENTRY_BASE));\r
-        ASSERT (ConfigFormEntry != NULL);\r
-\r
-        UnicodeSPrint (PortString, (UINTN) 128, L"Port %s", ConfigFormEntry->MacString);\r
-        DeviceFormTitleToken = (EFI_STRING_ID) STR_ISCSI_DEVICE_FORM_TITLE;\r
-        HiiSetString (Private->RegisteredHandle, DeviceFormTitleToken, PortString, NULL);\r
-\r
-        IScsiConvertDeviceConfigDataToIfrNvData (ConfigFormEntry, IfrNvData);\r
-\r
-        Private->Current = ConfigFormEntry;\r
-      }\r
-\r
       break;\r
     }\r
+  }\r
 \r
-    if (!EFI_ERROR (Status)) {\r
-      //\r
-      // Pass changed uncommitted data back to Form Browser\r
-      //\r
-      HiiSetBrowserData (&mVendorGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData, NULL);\r
-    }\r
-    \r
-    FreePool (IfrNvData);\r
-\r
-    return Status;\r
+  if (!EFI_ERROR (Status)) {\r
+    //\r
+    // Pass changed uncommitted data back to Form Browser\r
+    //\r
+    HiiSetBrowserData (&gIp4IScsiConfigGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData, NULL);\r
   }\r
 \r
-  //\r
-  // All other action return unsupported.\r
-  //\r
-  return EFI_UNSUPPORTED;\r
+  FreePool (IfrNvData);\r
+\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -1013,12 +1033,12 @@ IScsiConfigUpdateForm (
                       );\r
       if (EFI_ERROR (Status)) {\r
         ZeroMem (&ConfigFormEntry->SessionConfigData, sizeof (ConfigFormEntry->SessionConfigData));\r
-        \r
+\r
         //\r
         // Generate OUI-format ISID based on MAC address.\r
         //\r
         CopyMem (ConfigFormEntry->SessionConfigData.IsId, &MacAddress, 6);\r
-        ConfigFormEntry->SessionConfigData.IsId[0] = \r
+        ConfigFormEntry->SessionConfigData.IsId[0] =\r
           (UINT8) (ConfigFormEntry->SessionConfigData.IsId[0] & 0x3F);\r
       }\r
       //\r
@@ -1027,7 +1047,7 @@ IScsiConfigUpdateForm (
       BufferSize = sizeof (ConfigFormEntry->AuthConfigData);\r
       Status = gRT->GetVariable (\r
                       ConfigFormEntry->MacString,\r
-                      &mIScsiCHAPAuthInfoGuid,\r
+                      &gIScsiCHAPAuthInfoGuid,\r
                       NULL,\r
                       &BufferSize,\r
                       &ConfigFormEntry->AuthConfigData\r
@@ -1038,13 +1058,13 @@ IScsiConfigUpdateForm (
       //\r
       // Compose the Port string and create a new EFI_STRING_ID.\r
       //\r
-      UnicodeSPrint (PortString, 128, L"Port %s", ConfigFormEntry->MacString);\r
+      UnicodeSPrint (PortString, sizeof (PortString), L"Port %s", ConfigFormEntry->MacString);\r
       ConfigFormEntry->PortTitleToken = HiiSetString (mCallbackInfo->RegisteredHandle, 0, PortString, NULL);\r
 \r
       //\r
       // Compose the help string of this port and create a new EFI_STRING_ID.\r
       //\r
-      UnicodeSPrint (PortString, 128, L"Set the iSCSI parameters on port %s", ConfigFormEntry->MacString);\r
+      UnicodeSPrint (PortString, sizeof (PortString), L"Set the iSCSI parameters on port %s", ConfigFormEntry->MacString);\r
       ConfigFormEntry->PortTitleHelpToken = HiiSetString (mCallbackInfo->RegisteredHandle, 0, PortString, NULL);\r
 \r
       InsertTailList (&mIScsiConfigFormList, &ConfigFormEntry->Link);\r
@@ -1056,6 +1076,7 @@ IScsiConfigUpdateForm (
     mNumberOfIScsiDevices--;\r
     RemoveEntryList (&ConfigFormEntry->Link);\r
     FreePool (ConfigFormEntry);\r
+    mCallbackInfo->Current = NULL;\r
   }\r
   //\r
   // Allocate space for creation of Buffer\r
@@ -1102,7 +1123,7 @@ IScsiConfigUpdateForm (
 \r
   HiiUpdateForm (\r
     mCallbackInfo->RegisteredHandle,\r
-    &mVendorGuid,\r
+    &gIp4IScsiConfigGuid,\r
     FORMID_MAIN_FORM,\r
     StartOpCodeHandle, // Label DEVICE_ENTRY_LABEL\r
     EndOpCodeHandle    // LABEL_END\r
@@ -1168,14 +1189,14 @@ IScsiConfigFormInit (
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
-  \r
+\r
   //\r
   // Publish our HII data\r
   //\r
   CallbackInfo->RegisteredHandle = HiiAddPackages (\r
-                                     &mVendorGuid,\r
+                                     &gIp4IScsiConfigGuid,\r
                                      CallbackInfo->DriverHandle,\r
-                                     IScsiDxeStrings,\r
+                                     IScsi4DxeStrings,\r
                                      IScsiConfigDxeBin,\r
                                      NULL\r
                                      );\r
@@ -1195,7 +1216,7 @@ IScsiConfigFormInit (
   free the resources used.\r
 \r
   @param[in]  DriverBindingHandle The iSCSI driverbinding handle.\r
-  \r
+\r
   @retval EFI_SUCCESS             The iSCSI configuration form is unloaded.\r
   @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
 **/\r