/** @file\r
\r
+ Implementation of the USB mass storage Bulk-Only Transport protocol.\r
+\r
Copyright (c) 2007 - 2008, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- UsbMassBot.c\r
+**/\r
\r
-Abstract:\r
+#include "UsbMass.h"\r
+#include "UsbMassBot.h"\r
\r
- Implementation of the USB mass storage Bulk-Only Transport protocol.\r
+/**\r
+ Reset the mass storage device by BOT protocol.\r
\r
-Revision History\r
+ @param Context The context of the BOT protocol, that is,\r
+ USB_BOT_PROTOCOL.\r
+ @param ExtendedVerification The flag controlling the rule of reset dev.\r
\r
+ @retval EFI_SUCCESS The device is reset.\r
+ @retval Others Failed to reset the device..\r
\r
**/\r
-\r
-#include "UsbMass.h"\r
-#include "UsbMassBot.h"\r
-\r
-STATIC\r
EFI_STATUS\r
UsbBotResetDevice (\r
IN VOID *Context,\r
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory\r
@retval EFI_UNSUPPORTED The transport protocol doesn't support the device.\r
@retval EFI_SUCCESS The device is supported and protocol initialized.\r
+ @retval Other The UBS BOT initialization fails.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotInit (\r
IN EFI_USB_IO_PROTOCOL * UsbIo,\r
\r
\r
/**\r
- Send the command to the device using Bulk-Out endpoint\r
+ Send the command to the device using Bulk-Out endpoint.\r
\r
@param UsbBot The USB BOT device\r
@param Cmd The command to transfer to device\r
@retval Others Failed to send the command to device\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotSendCommand (\r
IN USB_BOT_PROTOCOL *UsbBot,\r
@retval Others Failed to transfer data\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotDataTransfer (\r
IN USB_BOT_PROTOCOL *UsbBot,\r
and return the high level command execution result in Result. So\r
even it returns EFI_SUCCESS, the command may still have failed.\r
\r
- @param UsbBot The USB BOT device\r
- @param TransLen The expected length of the data\r
- @param Timeout The time to wait the command to complete\r
+ @param UsbBot The USB BOT device.\r
+ @param TransLen The expected length of the data.\r
@param CmdStatus The result of the command execution.\r
\r
- @retval EFI_DEVICE_ERROR Failed to retrieve the command execute result\r
@retval EFI_SUCCESS Command execute result is retrieved and in the\r
Result.\r
+ @retval Other Failed to get status.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotGetStatus (\r
IN USB_BOT_PROTOCOL *UsbBot,\r
\r
/**\r
Call the Usb mass storage class transport protocol to issue\r
- the command/data/status circle to execute the commands\r
+ the command/data/status circle to execute the commands.\r
\r
@param Context The context of the BOT protocol, that is,\r
USB_BOT_PROTOCOL\r
@param Timeout The time to wait command\r
@param CmdStatus The result of high level command execution\r
\r
- @retval EFI_DEVICE_ERROR Failed to excute command\r
@retval EFI_SUCCESS The command is executed OK, and result in CmdStatus\r
+ @retval Other Failed to excute command\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotExecCommand (\r
IN VOID *Context,\r
\r
\r
/**\r
- Reset the mass storage device by BOT protocol\r
+ Reset the mass storage device by BOT protocol.\r
\r
@param Context The context of the BOT protocol, that is,\r
- USB_BOT_PROTOCOL\r
+ USB_BOT_PROTOCOL.\r
+ @param ExtendedVerification The flag controlling the rule of reset dev.\r
\r
- @retval EFI_SUCCESS The device is reset\r
- @retval Others Failed to reset the device.\r
+ @retval EFI_SUCCESS The device is reset.\r
+ @retval Others Failed to reset the device..\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotResetDevice (\r
IN VOID *Context,\r
return Status;\r
}\r
\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Reset the mass storage device by BOT protocol\r
\r
-Arguments:\r
-\r
- Context - The context of the BOT protocol, that is, USB_BOT_PROTOCOL\r
- MaxLun - Return pointer to the max number of lun. Maxlun=1 means lun0 and \r
- lun1 in all.\r
+/**\r
+ Get the max lun of mass storage device.\r
\r
-Returns:\r
+ @param Context The context of the BOT protocol, that is, USB_BOT_PROTOCOL\r
+ @param MaxLun Return pointer to the max number of lun. Maxlun=1 means lun0 and\r
+ lun1 in all.\r
\r
- EFI_SUCCESS - The device is reset\r
- Others - Failed to reset the device.\r
+ @retval EFI_SUCCESS Get max lun success.\r
+ @retval Others Failed to execute this request.\r
\r
---*/\r
-STATIC\r
+**/\r
EFI_STATUS\r
UsbBotGetMaxLun (\r
IN VOID *Context,\r
IN UINT8 *MaxLun\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Reset the mass storage device by BOT protocol\r
-\r
-Arguments:\r
-\r
- Context - The context of the BOT protocol, that is, USB_BOT_PROTOCOL\r
- MaxLun - Return pointer to the max number of lun. Maxlun=1 means lun0 and \r
- lun1 in all.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The device is reset\r
- Others - Failed to reset the device.\r
-\r
---*/\r
{\r
USB_BOT_PROTOCOL *UsbBot;\r
EFI_USB_DEVICE_REQUEST Request;\r
}\r
\r
/**\r
- Clean up the resource used by this BOT protocol\r
+ Clean up the resource used by this BOT protocol.\r
\r
@param Context The context of the BOT protocol, that is,\r
- USB_BOT_PROTOCOL\r
+ USB_BOT_PROTOCOL.\r
\r
@retval EFI_SUCCESS The resource is cleaned up.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
UsbBotFini (\r
IN VOID *Context\r