]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
MdeModulePkg/UsbMass: Not retry if usb bot transfer execution fail
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBoot.c
index 9f996507034f91cfd4486ea0b82034d650fe39d2..96c3622821c754107db9c2c3fc170e08bf7d9e97 100644 (file)
@@ -2,7 +2,7 @@
   Implementation of the command set of USB Mass Storage Specification\r
   for Bootability, Revision 1.0.\r
 \r
-Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2016, 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
@@ -189,6 +189,11 @@ UsbBootExecCmd (
     return EFI_TIMEOUT;\r
   }\r
 \r
+  if (Status == EFI_DEVICE_ERROR) {\r
+    DEBUG ((EFI_D_ERROR, "UsbBootExecCmd: Device Error to Exec 0x%x Cmd\n", *(UINT8 *)Cmd));\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
   //\r
   // If ExecCommand() returns no error and CmdResult is success,\r
   // then the commnad transfer is successful.\r
@@ -271,7 +276,7 @@ UsbBootExecCmdWithRetry (
                DataLen,\r
                Timeout\r
                );\r
-    if (Status == EFI_SUCCESS || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA) {\r
+    if (Status == EFI_SUCCESS || Status == EFI_MEDIA_CHANGED || Status == EFI_NO_MEDIA || Status == EFI_DEVICE_ERROR) {\r
       break;\r
     }\r
     //\r