]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBot.c
index 178aa80d3e3ab3560a4961fa7482591a0b3acb4c..9871d9359d1c8fdfbeb196da93dd3de3f9b3c7b4 100644 (file)
@@ -2,8 +2,8 @@
   Implementation of the USB mass storage Bulk-Only Transport protocol,\r
   according to USB Mass Storage Class Bulk-Only Transport, Revision 1.0.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2008, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "UsbMass.h"\r
+#include "UsbMassBoot.h"\r
 #include "UsbMassBot.h"\r
 \r
 //\r
@@ -58,9 +58,7 @@ UsbBotInit (
   //\r
   // Allocate the BOT context for USB_BOT_PROTOCOL and two endpoint descriptors.\r
   //\r
-  UsbBot = AllocateZeroPool (\r
-             sizeof (USB_BOT_PROTOCOL) + 2 * sizeof (EFI_USB_ENDPOINT_DESCRIPTOR)\r
-             );\r
+  UsbBot = AllocateZeroPool (sizeof (USB_BOT_PROTOCOL) + 2 * sizeof (EFI_USB_ENDPOINT_DESCRIPTOR));\r
   ASSERT (UsbBot != NULL);\r
 \r
   UsbBot->UsbIo = UsbIo;\r
@@ -103,7 +101,7 @@ UsbBotInit (
        (UsbBot->BulkOutEndpoint == NULL)) {\r
 \r
       UsbBot->BulkOutEndpoint   = (EFI_USB_ENDPOINT_DESCRIPTOR *) (UsbBot + 1) + 1;\r
-      CopyMem(UsbBot->BulkOutEndpoint, &EndPoint, sizeof(EndPoint));\r
+      CopyMem (UsbBot->BulkOutEndpoint, &EndPoint, sizeof(EndPoint));\r
     }\r
   }\r
 \r
@@ -123,13 +121,13 @@ UsbBotInit (
   if (Context != NULL) {\r
     *Context = UsbBot;\r
   } else {\r
-    gBS->FreePool (UsbBot);\r
+    FreePool (UsbBot);\r
   }\r
 \r
   return EFI_SUCCESS;\r
 \r
 ON_ERROR:\r
-  gBS->FreePool (UsbBot);\r
+  FreePool (UsbBot);\r
   return Status;\r
 }\r
 \r
@@ -275,9 +273,16 @@ UsbBotDataTransfer (
                             );\r
   if (EFI_ERROR (Status)) {\r
     if (USB_IS_ERROR (Result, EFI_USB_ERR_STALL)) {\r
+      DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: (%r)\n", Status));      \r
+      DEBUG ((EFI_D_INFO, "UsbBotDataTransfer: DataIn Stall\n"));\r
       UsbClearEndpointStall (UsbBot->UsbIo, Endpoint->EndpointAddress);\r
     } else if (USB_IS_ERROR (Result, EFI_USB_ERR_NAK)) {\r
       Status = EFI_NOT_READY;\r
+    } else {\r
+      DEBUG ((EFI_D_ERROR, "UsbBotDataTransfer: (%r)\n", Status));\r
+    }\r
+    if(Status == EFI_TIMEOUT){\r
+      UsbBotResetDevice(UsbBot, FALSE);\r
     }\r
   }\r
 \r
@@ -589,7 +594,7 @@ UsbBotCleanUp (
   IN  VOID                    *Context\r
   )\r
 {\r
-  gBS->FreePool (Context);\r
+  FreePool (Context);\r
   return EFI_SUCCESS;\r
 }\r
 \r