Notice: it is being obsoleted by the standard body in favor of the BOT\r
(Bulk-Only Transport).\r
\r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2018, 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
**/\r
\r
#include "UsbMass.h"\r
-#include "UsbMassCbi.h"\r
\r
//\r
// Definition of USB CBI0 Transport Protocol\r
if (Context != NULL) {\r
*Context = UsbCbi;\r
} else {\r
- gBS->FreePool (UsbCbi);\r
+ FreePool (UsbCbi);\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
\r
ON_ERROR:\r
- gBS->FreePool (UsbCbi);\r
+ FreePool (UsbCbi);\r
return Status;\r
}\r
\r
//\r
Status = UsbCbiSendCommand (UsbCbi, Cmd, CmdLen, Timeout);\r
if (EFI_ERROR (Status)) {\r
+ gBS->Stall(10 * USB_MASS_1_MILLISECOND);\r
DEBUG ((EFI_D_ERROR, "UsbCbiExecCommand: UsbCbiSendCommand (%r)\n",Status));\r
return Status;\r
}\r
//\r
// For UFI device, ASC and ASCQ are returned.\r
//\r
- if (Result.Type != 0) {\r
+ // Do not set the USB_MASS_CMD_FAIL for a request sense command\r
+ // as a bad result type doesn't mean a cmd failure\r
+ //\r
+ if (Result.Type != 0 && *(UINT8*)Cmd != 0x03) {\r
*CmdStatus = USB_MASS_CMD_FAIL;\r
}\r
-\r
} else {\r
//\r
// Check page 27, CBI spec 1.1 for vaious reture status.\r
//\r
Status = UsbCbiSendCommand (UsbCbi, ResetCmd, USB_CBI_RESET_CMD_LEN, Timeout);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ return EFI_DEVICE_ERROR;\r
}\r
\r
//\r
IN VOID *Context\r
)\r
{\r
- gBS->FreePool (Context);\r
+ FreePool (Context);\r
return EFI_SUCCESS;\r
}\r