]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c
modify coding style to pass ecc tool
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBot.c
index c6168ec87d68557a37ae58808e9e5717c12066c3..ba5f9d025b7275be0a190bc0786fa3776c6e7cd5 100644 (file)
@@ -1,5 +1,7 @@
 /** @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
@@ -9,23 +11,22 @@ http://opensource.org/licenses/bsd-license.php
 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
@@ -44,9 +45,9 @@ UsbBotResetDevice (
   @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
@@ -140,7 +141,7 @@ ON_ERROR:
 \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
@@ -154,7 +155,6 @@ ON_ERROR:
   @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
@@ -232,7 +232,6 @@ UsbBotSendCommand (
   @retval Others                Failed to transfer data\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 UsbBotDataTransfer (\r
   IN USB_BOT_PROTOCOL         *UsbBot,\r
@@ -294,17 +293,15 @@ UsbBotDataTransfer (
   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
@@ -380,7 +377,7 @@ UsbBotGetStatus (
 \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
@@ -393,11 +390,10 @@ UsbBotGetStatus (
   @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
@@ -455,16 +451,16 @@ UsbBotExecCommand (
 \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
@@ -530,48 +526,23 @@ UsbBotResetDevice (
   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
@@ -612,15 +583,14 @@ Returns:
 }\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