+/**\r
+ Update the component name for the Mtftp4 child handle.\r
+\r
+ @param Mtftp4[in] A pointer to the EFI_MTFTP4_PROTOCOL.\r
+\r
+ \r
+ @retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.\r
+ @retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
+ \r
+**/\r
+EFI_STATUS\r
+UpdateName (\r
+ IN EFI_MTFTP4_PROTOCOL *Mtftp4\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ CHAR16 HandleName[80];\r
+ EFI_MTFTP4_MODE_DATA ModeData;\r
+\r
+ if (Mtftp4 == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Format the child name into the string buffer as:\r
+ // MTFTPv4 (ServerIp=192.168.1.10, ServerPort=69)\r
+ //\r
+ Status = Mtftp4->GetModeData (Mtftp4, &ModeData);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ UnicodeSPrint (HandleName, sizeof (HandleName),\r
+ L"MTFTPv4 (ServerIp=%d.%d.%d.%d, ServerPort=%d)",\r
+ ModeData.ConfigData.ServerIp.Addr[0],\r
+ ModeData.ConfigData.ServerIp.Addr[1],\r
+ ModeData.ConfigData.ServerIp.Addr[2],\r
+ ModeData.ConfigData.ServerIp.Addr[3],\r
+ ModeData.ConfigData.InitialServerPort\r
+ );\r
+\r
+ if (gMtftp4ControllerNameTable != NULL) {\r
+ FreeUnicodeStringTable (gMtftp4ControllerNameTable);\r
+ gMtftp4ControllerNameTable = NULL;\r
+ }\r
+ \r
+ Status = AddUnicodeString2 (\r
+ "eng",\r
+ gMtftp4ComponentName.SupportedLanguages,\r
+ &gMtftp4ControllerNameTable,\r
+ HandleName,\r
+ TRUE\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+ \r
+ return AddUnicodeString2 (\r
+ "en",\r
+ gMtftp4ComponentName2.SupportedLanguages,\r
+ &gMtftp4ControllerNameTable,\r
+ HandleName,\r
+ FALSE\r
+ );\r
+}\r
+\r