]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Bus / Scsi / ScsiBusDxe / ScsiBus.h
index e6210773ce76dd77a09dd8211b5371224612a19d..a637042af7bb4a095ba68d91fe4a3fa383af8154 100644 (file)
@@ -1,42 +1,51 @@
-/*++\r
+/** @file\r
+  Header file for SCSI Bus Driver.\r
 \r
-Copyright (c) 2006, 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
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \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
+Copyright (c) 2006 - 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
-Module Name:\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
-    ScsiBus.h\r
+**/\r
 \r
-Abstract:\r
+#ifndef _SCSI_BUS_H_\r
+#define _SCSI_BUS_H_\r
 \r
-    Header file for SCSI Bus Driver.\r
 \r
-Revision History\r
---*/\r
+#include <Uefi.h>\r
 \r
-#ifndef _SCSI_BUS_H\r
-#define _SCSI_BUS_H\r
+#include <Protocol/ScsiPassThru.h>\r
+#include <Protocol/ScsiPassThruExt.h>\r
+#include <Protocol/ScsiIo.h>\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/DevicePath.h>\r
 \r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiScsiLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
 \r
-#include <IndustryStandard/scsi.h>\r
-//\r
-// 1000 * 1000 * 10\r
-//\r
-#define ONE_SECOND_TIMER      10000000  \r
+#include <IndustryStandard/Scsi.h>\r
 \r
-#define SCSI_IO_DEV_SIGNATURE EFI_SIGNATURE_32 ('s', 'c', 'i', 'o')\r
+#define SCSI_IO_DEV_SIGNATURE SIGNATURE_32 ('s', 'c', 'i', 'o')\r
+\r
+typedef union {\r
+  UINT32  Scsi;\r
+  UINT8   ExtScsi[4];\r
+} SCSI_ID;\r
 \r
 typedef struct _SCSI_TARGET_ID {\r
- union {\r
-   UINT32  Scsi;\r
-   UINT8   ExtScsi[4];   \r
- } ScsiId;\r
+  SCSI_ID ScsiId;\r
   UINT8   ExtScsiId[12];\r
 }SCSI_TARGET_ID;\r
 \r
@@ -46,15 +55,47 @@ typedef struct {
    VOID   *Data2;\r
 } SCSI_EVENT_DATA;\r
 \r
+//\r
+// SCSI Bus Controller device strcuture\r
+//\r
+#define SCSI_BUS_DEVICE_SIGNATURE  SIGNATURE_32 ('s', 'c', 's', 'i')\r
+\r
+//\r
+// SCSI Bus Timeout Experience Value\r
+//\r
+#define SCSI_BUS_TIMEOUT           EFI_TIMER_PERIOD_SECONDS (3)\r
+\r
+//\r
+// The ScsiBusProtocol is just used to locate ScsiBusDev\r
+// structure in the SCSIBusDriverBindingStop(). Then we can\r
+// Close all opened protocols and release this structure.\r
+// ScsiBusProtocol is the private protocol.\r
+// gEfiCallerIdGuid will be used as its protocol guid.\r
+//\r
+typedef struct _EFI_SCSI_BUS_PROTOCOL {\r
+  UINT64  Reserved;\r
+} EFI_SCSI_BUS_PROTOCOL;\r
+\r
+typedef struct _SCSI_BUS_DEVICE {\r
+  UINTN                                 Signature;\r
+  EFI_SCSI_BUS_PROTOCOL                 BusIdentify;\r
+  BOOLEAN                               ExtScsiSupport;\r
+  EFI_SCSI_PASS_THRU_PROTOCOL           *ScsiInterface;\r
+  EFI_EXT_SCSI_PASS_THRU_PROTOCOL       *ExtScsiInterface;\r
+  EFI_DEVICE_PATH_PROTOCOL              *DevicePath;\r
+} SCSI_BUS_DEVICE;\r
+\r
+#define SCSI_BUS_CONTROLLER_DEVICE_FROM_THIS(a)  CR (a, SCSI_BUS_DEVICE, BusIdentify, SCSI_BUS_DEVICE_SIGNATURE)\r
 \r
 typedef struct {\r
   UINT32                             Signature;\r
   EFI_HANDLE                         Handle;\r
   EFI_SCSI_IO_PROTOCOL               ScsiIo;\r
   EFI_DEVICE_PATH_PROTOCOL           *DevicePath;\r
-  BOOLEAN                            ExtScsiSupport; \r
+  BOOLEAN                            ExtScsiSupport;\r
   EFI_SCSI_PASS_THRU_PROTOCOL        *ScsiPassThru;\r
   EFI_EXT_SCSI_PASS_THRU_PROTOCOL    *ExtScsiPassThru;\r
+  SCSI_BUS_DEVICE                    *ScsiBusDeviceData;\r
   SCSI_TARGET_ID                     Pun;\r
   UINT64                             Lun;\r
   UINT8                              ScsiDeviceType;\r
@@ -65,37 +106,31 @@ typedef struct {
 #define SCSI_IO_DEV_FROM_THIS(a)  CR (a, SCSI_IO_DEV, ScsiIo, SCSI_IO_DEV_SIGNATURE)\r
 \r
 //\r
-// SCSI Bus Controller device strcuture\r
+// Global Variables\r
 //\r
-#define EFI_SCSI_BUS_PROTOCOL_GUID \\r
-  { \\r
-    0x5261213D, 0x3A3D, 0x441E, {0xB3, 0xAF, 0x21, 0xD3, 0xF7, 0xA4, 0xCA, 0x17} \\r
-  }\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gScsiBusDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gScsiBusComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gScsiBusComponentName2;\r
 \r
-typedef struct _EFI_SCSI_BUS_PROTOCOL {\r
-  UINT64  Reserved;\r
-} EFI_SCSI_BUS_PROTOCOL;\r
+/**\r
+  Test to see if this driver supports ControllerHandle.\r
 \r
-#define SCSI_BUS_DEVICE_SIGNATURE  EFI_SIGNATURE_32 ('s', 'c', 's', 'i')\r
+  This service is called by the EFI boot service ConnectController(). In order\r
+  to make drivers as small as possible, there are a few calling restrictions for\r
+  this service. ConnectController() must follow these calling restrictions. If\r
+  any other agent wishes to call Supported() it must also follow these calling\r
+  restrictions.\r
 \r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
 \r
-typedef struct _SCSI_BUS_DEVICE {\r
-  UINTN                                 Signature;\r
-  EFI_SCSI_BUS_PROTOCOL                 BusIdentify;\r
-  BOOLEAN                               ExtScsiSupport; \r
-  EFI_SCSI_PASS_THRU_PROTOCOL           *ScsiInterface;\r
-  EFI_EXT_SCSI_PASS_THRU_PROTOCOL       *ExtScsiInterface;\r
-  EFI_DEVICE_PATH_PROTOCOL              *DevicePath;\r
-} SCSI_BUS_DEVICE;\r
-\r
-#define SCSI_BUS_CONTROLLER_DEVICE_FROM_THIS(a)  CR (a, SCSI_BUS_DEVICE, BusIdentify, SCSI_BUS_DEVICE_SIGNATURE)\r
-\r
-//\r
-// Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gScsiBusDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gScsiBusComponentName;\r
+  @retval EFI_SUCCESS         This driver supports this device\r
+  @retval EFI_ALREADY_STARTED This driver is already running on this device\r
+  @retval other               This driver does not support this device\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SCSIBusDriverBindingSupported (\r
@@ -104,6 +139,25 @@ SCSIBusDriverBindingSupported (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Start this driver on ControllerHandle.\r
+\r
+  This service is called by the EFI boot service ConnectController(). In order\r
+  to make drivers as small as possible, there are a few calling restrictions for\r
+  this service. ConnectController() must follow these calling restrictions. If\r
+  any other agent wishes to call Start() it must also follow these calling\r
+  restrictions.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SCSIBusDriverBindingStart (\r
@@ -112,6 +166,25 @@ SCSIBusDriverBindingStart (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Stop this driver on ControllerHandle.\r
+\r
+  This service is called by the EFI boot service DisconnectController().\r
+  In order to make drivers as small as possible, there are a few calling\r
+  restrictions for this service. DisconnectController() must follow these\r
+  calling restrictions. If any other agent wishes to call Stop() it must also\r
+  follow these calling restrictions.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SCSIBusDriverBindingStop (\r
@@ -124,6 +197,45 @@ SCSIBusDriverBindingStop (
 //\r
 // EFI Component Name Functions\r
 //\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This                  A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  Language              A pointer to a Null-terminated ASCII string\r
+                                array indicating the language. This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified\r
+                                in RFC 4646 or ISO 639-2 language code format.\r
+\r
+  @param  DriverName            A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ScsiBusComponentNameGetDriverName (\r
@@ -132,6 +244,74 @@ ScsiBusComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   );\r
 \r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by a driver.\r
+\r
+  This function retrieves the user readable name of the controller specified by\r
+  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+  driver specified by This has a user readable name in the language specified by\r
+  Language, then a pointer to the controller name is returned in ControllerName,\r
+  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
+  managing the controller specified by ControllerHandle and ChildHandle,\r
+  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This                  A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle      The handle of a controller that the driver\r
+                                specified by This is managing.  This handle\r
+                                specifies the controller whose name is to be\r
+                                returned.\r
+\r
+  @param  ChildHandle           The handle of the child controller to retrieve\r
+                                the name of.  This is an optional parameter that\r
+                                may be NULL.  It will be NULL for device\r
+                                drivers.  It will also be NULL for a bus drivers\r
+                                that wish to retrieve the name of the bus\r
+                                controller.  It will not be NULL for a bus\r
+                                driver that wishes to retrieve the name of a\r
+                                child controller.\r
+\r
+  @param  Language              A pointer to a Null-terminated ASCII string\r
+                                array indicating the language.  This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified in\r
+                                RFC 4646 or ISO 639-2 language code format.\r
+\r
+  @param  ControllerName        A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                controller specified by ControllerHandle and\r
+                                ChildHandle in the language specified by\r
+                                Language from the point of view of the driver\r
+                                specified by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
+                                the language specified by Language for the\r
+                                driver specified by This was returned in\r
+                                DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+                                EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ScsiBusComponentNameGetControllerName (\r
@@ -142,199 +322,171 @@ ScsiBusComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName\r
   );\r
 \r
+/**\r
+  Retrieves the device type information of the SCSI Controller.\r
+\r
+  @param  This          Protocol instance pointer.\r
+  @param  DeviceType    A pointer to the device type information retrieved from\r
+                        the SCSI Controller.\r
+\r
+  @retval EFI_SUCCESS             Retrieves the device type information successfully.\r
+  @retval EFI_INVALID_PARAMETER   The DeviceType is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 ScsiGetDeviceType (\r
   IN  EFI_SCSI_IO_PROTOCOL     *This,\r
   OUT UINT8                    *DeviceType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Retrieves the device type information of the SCSI Controller.\r
-    \r
-Arguments:\r
-\r
-  This                  - Protocol instance pointer.\r
-  DeviceType            - A pointer to the device type information\r
-                            retrieved from the SCSI Controller. \r
+  );\r
 \r
-Returns:\r
+/**\r
+  Retrieves the device location in the SCSI channel.\r
 \r
-  EFI_SUCCESS           - Retrieves the device type information successfully.\r
-  EFI_INVALID_PARAMETER - The DeviceType is NULL.\r
+  @param  This   Protocol instance pointer.\r
+  @param  Target A pointer to the Target ID of a SCSI device\r
+                 on the SCSI channel.\r
+  @param  Lun    A pointer to the LUN of the SCSI device on\r
+                 the SCSI channel.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS           Retrieves the device location successfully.\r
+  @retval EFI_INVALID_PARAMETER The Target or Lun is NULL.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
-ScsiResetBus (\r
-  IN  EFI_SCSI_IO_PROTOCOL     *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+ScsiGetDeviceLocation (\r
+  IN  EFI_SCSI_IO_PROTOCOL    *This,\r
+  IN OUT UINT8                **Target,\r
+  OUT UINT64                  *Lun\r
+  );\r
 \r
+/**\r
   Resets the SCSI Bus that the SCSI Controller is attached to.\r
-    \r
-Arguments:\r
-\r
-  This                  - Protocol instance pointer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The SCSI bus is reset successfully.\r
-  EFI_DEVICE_ERROR      - Errors encountered when resetting the SCSI bus.\r
-  EFI_UNSUPPORTED       - The bus reset operation is not supported by the\r
-                          SCSI Host Controller.\r
-  EFI_TIMEOUT           - A timeout occurred while attempting to reset \r
-                          the SCSI bus.\r
 \r
---*/\r
-;\r
+  @param  This  Protocol instance pointer.\r
 \r
+  @retval  EFI_SUCCESS       The SCSI bus is reset successfully.\r
+  @retval  EFI_DEVICE_ERROR  Errors encountered when resetting the SCSI bus.\r
+  @retval  EFI_UNSUPPORTED   The bus reset operation is not supported by the\r
+                             SCSI Host Controller.\r
+  @retval  EFI_TIMEOUT       A timeout occurred while attempting to reset\r
+                             the SCSI bus.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
-ScsiResetDevice (\r
+ScsiResetBus (\r
   IN  EFI_SCSI_IO_PROTOCOL     *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
+/**\r
   Resets the SCSI Controller that the device handle specifies.\r
-    \r
-Arguments:\r
 \r
-  This                  - Protocol instance pointer.\r
-    \r
-Returns:\r
-\r
-  EFI_SUCCESS           - Reset the SCSI controller successfully.\r
-  EFI_DEVICE_ERROR      - Errors are encountered when resetting the\r
-                          SCSI Controller.\r
-  EFI_UNSUPPORTED       - The SCSI bus does not support a device \r
-                          reset operation.\r
-  EFI_TIMEOUT           - A timeout occurred while attempting to \r
-                          reset the SCSI Controller.\r
-\r
---*/\r
-;\r
+  @param  This  Protocol instance pointer.\r
 \r
+  @retval  EFI_SUCCESS       Reset the SCSI controller successfully.\r
+  @retval  EFI_DEVICE_ERROR  Errors are encountered when resetting the SCSI Controller.\r
+  @retval  EFI_UNSUPPORTED   The SCSI bus does not support a device reset operation.\r
+  @retval  EFI_TIMEOUT       A timeout occurred while attempting to reset the\r
+                             SCSI Controller.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
-ScsiExecuteSCSICommand (\r
-  IN  EFI_SCSI_IO_PROTOCOL                 *This,\r
-  IN OUT  EFI_SCSI_IO_SCSI_REQUEST_PACKET  *CommandPacket,\r
-  IN  EFI_EVENT                            Event\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+ScsiResetDevice (\r
+  IN  EFI_SCSI_IO_PROTOCOL     *This\r
+  );\r
 \r
+/**\r
   Sends a SCSI Request Packet to the SCSI Controller for execution.\r
-    \r
-Arguments:\r
 \r
-  This                  - Protocol instance pointer.\r
-  Packet                - The SCSI request packet to send to the SCSI \r
+  @param  This            Protocol instance pointer.\r
+  @param  CommandPacket   The SCSI request packet to send to the SCSI\r
                           Controller specified by the device handle.\r
-  Event                 - If the SCSI bus where the SCSI device is attached\r
-                          does not support non-blocking I/O, then Event is \r
-                          ignored, and blocking I/O is performed.  \r
+  @param  Event           If the SCSI bus where the SCSI device is attached\r
+                          does not support non-blocking I/O, then Event is\r
+                          ignored, and blocking I/O is performed.\r
                           If Event is NULL, then blocking I/O is performed.\r
-                          If Event is not NULL and non-blocking I/O is \r
+                          If Event is not NULL and non-blocking I/O is\r
                           supported, then non-blocking I/O is performed,\r
                           and Event will be signaled when the SCSI Request\r
                           Packet completes.\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The SCSI Request Packet was sent by the host \r
-                          successfully, and TransferLength bytes were \r
-                          transferred to/from DataBuffer.See \r
-                          HostAdapterStatus, TargetStatus, \r
-                          SenseDataLength, and SenseData in that order\r
-                          for additional status information.\r
-  EFI_BAD_BUFFER_SIZE   - The SCSI Request Packet was executed, \r
-                          but the entire DataBuffer could not be transferred.\r
-                          The actual number of bytes transferred is returned\r
-                          in TransferLength. See HostAdapterStatus, \r
-                          TargetStatus, SenseDataLength, and SenseData in \r
-                          that order for additional status information.\r
-  EFI_NOT_READY         - The SCSI Request Packet could not be sent because \r
-                          there are too many SCSI Command Packets already \r
-                          queued.The caller may retry again later.\r
-  EFI_DEVICE_ERROR      - A device error occurred while attempting to send \r
-                          the SCSI Request Packet. See HostAdapterStatus, \r
-                          TargetStatus, SenseDataLength, and SenseData in \r
-                          that order for additional status information.\r
-  EFI_INVALID_PARAMETER - The contents of CommandPacket are invalid.  \r
-                          The SCSI Request Packet was not sent, so no \r
-                          additional status information is available.\r
-  EFI_UNSUPPORTED       - The command described by the SCSI Request Packet\r
-                          is not supported by the SCSI initiator(i.e., SCSI \r
-                          Host Controller). The SCSI Request Packet was not\r
-                          sent, so no additional status information is \r
-                          available.\r
-  EFI_TIMEOUT           - A timeout occurred while waiting for the SCSI \r
-                          Request Packet to execute. See HostAdapterStatus,\r
-                          TargetStatus, SenseDataLength, and SenseData in \r
-                          that order for additional status information.\r
-\r
---*/\r
-;\r
 \r
+  @retval EFI_SUCCESS         The SCSI Request Packet was sent by the host\r
+                              successfully, and TransferLength bytes were\r
+                              transferred to/from DataBuffer.See\r
+                              HostAdapterStatus, TargetStatus,\r
+                              SenseDataLength, and SenseData in that order\r
+                              for additional status information.\r
+  @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
+                              but the entire DataBuffer could not be transferred.\r
+                              The actual number of bytes transferred is returned\r
+                              in TransferLength. See HostAdapterStatus,\r
+                              TargetStatus, SenseDataLength, and SenseData in\r
+                              that order for additional status information.\r
+  @retval EFI_NOT_READY       The SCSI Request Packet could not be sent because\r
+                              there are too many SCSI Command Packets already\r
+                              queued.The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR    A device error occurred while attempting to send\r
+                              the SCSI Request Packet. See HostAdapterStatus,\r
+                              TargetStatus, SenseDataLength, and SenseData in\r
+                              that order for additional status information.\r
+  @retval EFI_INVALID_PARAMETER  The contents of CommandPacket are invalid.\r
+                                 The SCSI Request Packet was not sent, so no\r
+                                 additional status information is available.\r
+  @retval EFI_UNSUPPORTED     The command described by the SCSI Request Packet\r
+                              is not supported by the SCSI initiator(i.e., SCSI\r
+                              Host Controller). The SCSI Request Packet was not\r
+                              sent, so no additional status information is\r
+                              available.\r
+  @retval EFI_TIMEOUT         A timeout occurred while waiting for the SCSI\r
+                              Request Packet to execute. See HostAdapterStatus,\r
+                              TargetStatus, SenseDataLength, and SenseData in\r
+                              that order for additional status information.\r
+**/\r
 EFI_STATUS\r
-ScsiScanCreateDevice (\r
-  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  EFI_HANDLE                    Controller,\r
-  SCSI_TARGET_ID                *TargetId,\r
-  UINT64                        Lun,\r
-  SCSI_BUS_DEVICE              *ScsiBusDev\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+EFIAPI\r
+ScsiExecuteSCSICommand (\r
+  IN  EFI_SCSI_IO_PROTOCOL                 *This,\r
+  IN OUT  EFI_SCSI_IO_SCSI_REQUEST_PACKET  *CommandPacket,\r
+  IN  EFI_EVENT                            Event  OPTIONAL\r
+  );\r
 \r
+/**\r
   Scan SCSI Bus to discover the device, and attach ScsiIoProtocol to it.\r
 \r
-Arguments:\r
-\r
-  This              - Protocol instance pointer\r
-  Controller        - Controller handle\r
-  Pun               - The Pun of the SCSI device on the SCSI channel.\r
-  Lun               - The Lun of the SCSI device on the SCSI channel.\r
-  ScsiBusDev        - The pointer of SCSI_BUS_DEVICE\r
+  @param  This           Protocol instance pointer\r
+  @param  Controller     Controller handle\r
+  @param  TargetId       Tartget to be scanned\r
+  @param  Lun            The Lun of the SCSI device on the SCSI channel.\r
+  @param  ScsiBusDev     The pointer of SCSI_BUS_DEVICE\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS           Successfully to discover the device and attach\r
+                                ScsiIoProtocol to it.\r
+  @retval EFI_OUT_OF_RESOURCES  Fail to discover the device.\r
 \r
-  EFI_SUCCESS       - Successfully to discover the device and attach ScsiIoProtocol to it.\r
-  EFI_OUT_OF_RESOURCES - Fail to discover the device.\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-DiscoverScsiDevice (\r
-  SCSI_IO_DEV   *ScsiIoDevice\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ScsiScanCreateDevice (\r
+  IN     EFI_DRIVER_BINDING_PROTOCOL   *This,\r
+  IN     EFI_HANDLE                    Controller,\r
+  IN     SCSI_TARGET_ID                *TargetId,\r
+  IN     UINT64                        Lun,\r
+  IN OUT SCSI_BUS_DEVICE               *ScsiBusDev\r
+  );\r
 \r
+/**\r
   Discovery SCSI Device\r
 \r
-Arguments:\r
-\r
-  ScsiIoDevice    - The pointer of SCSI_IO_DEV\r
+  @param  ScsiIoDevice    The pointer of SCSI_IO_DEV\r
 \r
-Returns:\r
+  @retval  TRUE   Find SCSI Device and verify it.\r
+  @retval  FALSE  Unable to find SCSI Device.\r
 \r
-  TRUE            - Find SCSI Device and verify it.\r
-  FALSE           - Unable to find SCSI Device.  \r
+**/\r
+BOOLEAN\r
+DiscoverScsiDevice (\r
+  IN  OUT  SCSI_IO_DEV   *ScsiIoDevice\r
+  );\r
 \r
---*/\r
-;\r
 #endif\r