]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c
Fixed unexpected timeout in Usb MassStorage Driver.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBot.c
index 6c92da9c717d54fda7f4f2362f608c42cffc234b..3f4d0fc4d35d9ac67f9f5064dfafa1ce3faac6b6 100644 (file)
@@ -191,7 +191,7 @@ UsbBotSendCommand (
 \r
   Result        = 0;\r
   DataLen       = sizeof (USB_BOT_CBW);\r
 \r
   Result        = 0;\r
   DataLen       = sizeof (USB_BOT_CBW);\r
-  Timeout       = USB_BOT_CBW_TIMEOUT / USB_MASS_STALL_1_MS;\r
+  Timeout       = USB_BOT_SEND_CBW_TIMEOUT / USB_MASS_1_MILLISECOND;\r
 \r
   //\r
   // Use the UsbIo to send the command to the device. The default\r
 \r
   //\r
   // Use the UsbIo to send the command to the device. The default\r
@@ -266,7 +266,7 @@ UsbBotDataTransfer (
   }\r
 \r
   Result  = 0;\r
   }\r
 \r
   Result  = 0;\r
-  Timeout = Timeout / USB_MASS_STALL_1_MS;\r
+  Timeout = Timeout / USB_MASS_1_MILLISECOND;\r
 \r
   Status = UsbBot->UsbIo->UsbBulkTransfer (\r
                             UsbBot->UsbIo,\r
 \r
   Status = UsbBot->UsbIo->UsbBulkTransfer (\r
                             UsbBot->UsbIo,\r
@@ -323,14 +323,14 @@ UsbBotGetStatus (
   EFI_USB_IO_PROTOCOL       *UsbIo;\r
   UINT32                    Index;\r
   UINTN                     Timeout;\r
   EFI_USB_IO_PROTOCOL       *UsbIo;\r
   UINT32                    Index;\r
   UINTN                     Timeout;\r
-\r
+  \r
   *CmdStatus = USB_BOT_COMMAND_ERROR;\r
   Status     = EFI_DEVICE_ERROR;\r
   Endpoint   = UsbBot->BulkInEndpoint->EndpointAddress;\r
   UsbIo      = UsbBot->UsbIo;\r
   *CmdStatus = USB_BOT_COMMAND_ERROR;\r
   Status     = EFI_DEVICE_ERROR;\r
   Endpoint   = UsbBot->BulkInEndpoint->EndpointAddress;\r
   UsbIo      = UsbBot->UsbIo;\r
-  Timeout    = USB_BOT_CSW_TIMEOUT / USB_MASS_STALL_1_MS;\r
+  Timeout    = USB_BOT_RECV_CSW_TIMEOUT / USB_MASS_1_MILLISECOND;\r
 \r
 \r
-  for (Index = 0; Index < USB_BOT_GET_STATUS_RETRY; Index++) {\r
+  for (Index = 0; Index < USB_BOT_RECV_CSW_RETRY; Index++) {\r
     //\r
     // Attemp to the read CSW from bulk in endpoint\r
     //\r
     //\r
     // Attemp to the read CSW from bulk in endpoint\r
     //\r
@@ -499,7 +499,7 @@ UsbBotResetDevice (
   Request.Value       = 0;\r
   Request.Index       = UsbBot->Interface.InterfaceNumber;\r
   Request.Length      = 0;\r
   Request.Value       = 0;\r
   Request.Index       = UsbBot->Interface.InterfaceNumber;\r
   Request.Length      = 0;\r
-  Timeout             = USB_BOT_RESET_TIMEOUT / USB_MASS_STALL_1_MS;\r
+  Timeout             = USB_BOT_RESET_DEVICE_TIMEOUT / USB_MASS_1_MILLISECOND;\r
 \r
   Status = UsbBot->UsbIo->UsbControlTransfer (\r
                             UsbBot->UsbIo,\r
 \r
   Status = UsbBot->UsbIo->UsbControlTransfer (\r
                             UsbBot->UsbIo,\r
@@ -521,7 +521,7 @@ UsbBotResetDevice (
   // complete. We can use this to sync the device and host. For\r
   // now just stall 100ms to wait the device.\r
   //\r
   // complete. We can use this to sync the device and host. For\r
   // now just stall 100ms to wait the device.\r
   //\r
-  gBS->Stall (USB_BOT_RESET_STALL);\r
+  gBS->Stall (USB_BOT_RESET_DEVICE_STALL);\r
 \r
   //\r
   // Clear the Bulk-In and Bulk-Out stall condition.\r
 \r
   //\r
   // Clear the Bulk-In and Bulk-Out stall condition.\r