]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c
Fixed unexpected timeout in Usb MassStorage Driver.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassCbi.c
index 5c07c548b9081631b3946a30cc10c3a475f3a3d8..016235055b2f0be43f9a3976812d7dc3a628f9fe 100644 (file)
@@ -194,7 +194,7 @@ UsbCbiSendCommand (
   Request.Length      = CmdLen;\r
 \r
   Status              = EFI_SUCCESS;\r
-  Timeout             = Timeout / USB_MASS_STALL_1_MS;\r
+  Timeout             = Timeout / USB_MASS_1_MILLISECOND;\r
 \r
   for (Retry = 0; Retry < USB_CBI_MAX_RETRY; Retry++) {\r
     //\r
@@ -281,7 +281,7 @@ UsbCbiDataTransfer (
   Remain  = *TransLen;\r
   Retry   = 0;\r
   Status  = EFI_SUCCESS;\r
-  Timeout = Timeout / USB_MASS_STALL_1_MS;\r
+  Timeout = Timeout / USB_MASS_1_MILLISECOND;\r
 \r
   //\r
   // Transfer the data, if the device returns NAK, retry it.\r
@@ -376,7 +376,7 @@ UsbCbiGetStatus (
 \r
   Endpoint  = UsbCbi->InterruptEndpoint->EndpointAddress;\r
   Status    = EFI_SUCCESS;\r
-  Timeout   = Timeout / USB_MASS_STALL_1_MS;\r
+  Timeout   = Timeout / USB_MASS_1_MILLISECOND;\r
 \r
   //\r
   // Attemp to the read the result from interrupt endpoint\r
@@ -555,7 +555,7 @@ UsbCbiResetDevice (
 \r
   ResetCmd[0] = 0x1D;\r
   ResetCmd[1] = 0x04;\r
-  Timeout     = USB_CBI_RESET_TIMEOUT / USB_MASS_STALL_1_MS;\r
+  Timeout     = USB_CBI_RESET_DEVICE_TIMEOUT / USB_MASS_1_MILLISECOND;\r
 \r
   //\r
   // Send the command to the device. Don't use UsbCbiExecCommand here.\r
@@ -570,7 +570,7 @@ UsbCbiResetDevice (
   // 50ms to wait it complete\r
   //\r
   UsbCbiGetStatus (UsbCbi, Timeout, &Result);\r
-  gBS->Stall (50 * 1000);\r
+  gBS->Stall (USB_CBI_RESET_DEVICE_STALL);\r
 \r
   //\r
   // Clear the Bulk-In and Bulk-Out stall condition and\r