]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IScsiDxe/IScsiDriver.h
Add IScsiDxe driver to NetworkPkg in order to support iSCSI over IPv6 stack and iSCSI...
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiDriver.h
diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.h b/NetworkPkg/IScsiDxe/IScsiDriver.h
new file mode 100644 (file)
index 0000000..ad6b83a
--- /dev/null
@@ -0,0 +1,678 @@
+/** @file\r
+  The header file of IScsiDriver.c.\r
+\r
+Copyright (c) 2004 - 2011, 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
+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
+**/\r
+\r
+#ifndef _ISCSI_DRIVER_H_\r
+#define _ISCSI_DRIVER_H_\r
+\r
+#define ISCSI_V4_PRIVATE_GUID \\r
+  { \\r
+    0xfa3cde4c, 0x87c2, 0x427d, { 0xae, 0xde, 0x7d, 0xd0, 0x96, 0xc8, 0x8c, 0x58 } \\r
+  }\r
+\r
+#define ISCSI_V6_PRIVATE_GUID \\r
+  { \\r
+    0x28be27e5, 0x66cc, 0x4a31, { 0xa3, 0x15, 0xdb, 0x14, 0xc3, 0x74, 0x4d, 0x85 } \\r
+  }\r
+\r
+#define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"\r
+\r
+#define IP_MODE_AUTOCONFIG_IP4     3\r
+#define IP_MODE_AUTOCONFIG_IP6     4\r
+#define IP_MODE_AUTOCONFIG_SUCCESS 5\r
+\r
+extern EFI_COMPONENT_NAME2_PROTOCOL       gIScsiComponentName2;\r
+extern EFI_COMPONENT_NAME_PROTOCOL        gIScsiComponentName;\r
+extern EFI_ISCSI_INITIATOR_NAME_PROTOCOL  gIScsiInitiatorName;\r
+extern EFI_AUTHENTICATION_INFO_PROTOCOL   gIScsiAuthenticationInfo;\r
+extern EFI_EXT_SCSI_PASS_THRU_PROTOCOL    gIScsiExtScsiPassThruProtocolTemplate;\r
+\r
+typedef struct {\r
+  CHAR16          PortString[ISCSI_NAME_IFR_MAX_SIZE];\r
+  LIST_ENTRY      NicInfoList;\r
+  UINT8           NicCount;\r
+  UINT8           CurrentNic;\r
+  UINT8           MaxNic;\r
+  BOOLEAN         Ipv6Flag;\r
+  BOOLEAN         OneSessionEstablished;\r
+  BOOLEAN         EnableMpio;\r
+  UINT8           MpioCount;            // The number of attempts in MPIO.\r
+  UINT8           Krb5MpioCount;        // The number of attempts login with KRB5 in MPIO.\r
+  UINT8           SinglePathCount;      // The number of single path attempts.\r
+  UINT8           ValidSinglePathCount; // The number of valid single path attempts.\r
+  UINT8           BootSelectedIndex;\r
+  UINT8           AttemptCount;\r
+  LIST_ENTRY      AttemptConfigs;       // User configured Attempt list.\r
+  CHAR8           InitiatorName[ISCSI_NAME_MAX_SIZE];\r
+  UINTN           InitiatorNameLength;\r
+} ISCSI_PRIVATE_DATA;\r
+\r
+extern ISCSI_PRIVATE_DATA                 *mPrivate;\r
+\r
+typedef struct {\r
+  LIST_ENTRY      Link;\r
+  UINT32          HwAddressSize;\r
+  EFI_MAC_ADDRESS PermanentAddress;\r
+  UINT8           NicIndex;\r
+  UINT16          VlanId;\r
+  UINTN           BusNumber;\r
+  UINTN           DeviceNumber;\r
+  UINTN           FunctionNumber;\r
+} ISCSI_NIC_INFO;\r
+\r
+typedef struct _ISCSI_PRIVATE_PROTOCOL {\r
+  UINT32  Reserved;\r
+} ISCSI_PRIVATE_PROTOCOL;\r
+\r
+//\r
+// EFI Driver Binding Protocol for iSCSI driver.\r
+//\r
+\r
+/**\r
+  Tests to see if this driver supports a given controller. If a child device is provided, \r
+  it tests to see if this driver supports creating a handle for the specified child device.\r
+\r
+  This function checks to see if the driver specified by This supports the device specified by \r
+  ControllerHandle. Drivers typically use the device path attached to \r
+  ControllerHandle and/or the services from the bus I/O abstraction attached to \r
+  ControllerHandle to determine if the driver supports ControllerHandle. This function \r
+  may be called many times during platform initialization. In order to reduce boot times, the tests \r
+  performed by this function must be very small and take as little time as possible to execute. This \r
+  function must not change the state of any hardware devices, and this function must be aware that the \r
+  device specified by ControllerHandle may already be managed by the same driver or a \r
+  different driver. This function must match its calls to AllocatePages() with FreePages(), \r
+  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().  \r
+  Since ControllerHandle may have been previously started by the same driver, if a protocol is \r
+  already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+  to guarantee the state of ControllerHandle is not modified by this function.\r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to test. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This \r
+                                   parameter is ignored by device drivers, and is optional for bus \r
+                                   drivers. For bus drivers, if this parameter is not NULL, then \r
+                                   the bus driver must determine if the bus controller specified \r
+                                   by ControllerHandle and the child controller specified \r
+                                   by RemainingDevicePath are both supported by this \r
+                                   bus driver.\r
+\r
+  @retval EFI_SUCCESS              The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is supported by the driver specified by This.\r
+  @retval EFI_ALREADY_STARTED      The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is already managed by the driver\r
+                                   specified by This.\r
+  @retval EFI_ACCESS_DENIED        The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is already managed by a different\r
+                                   driver or an application that requires exclusive access.\r
+                                   Currently not implemented.\r
+  @retval EFI_UNSUPPORTED          The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is not supported by the driver specified by This.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
+  );\r
+\r
+/**\r
+  Starts a device controller or a bus controller.\r
+\r
+  The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
+  As a result, much of the error checking on the parameters to Start() has been moved into this \r
+  common boot service. It is legal to call Start() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE.\r
+  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
+     EFI_DEVICE_PATH_PROTOCOL.\r
+  3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
+     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.  \r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This \r
+                                   parameter is ignored by device drivers, and is optional for bus \r
+                                   drivers. For a bus driver, if this parameter is NULL, then handles \r
+                                   for all the children of Controller are created by this driver.  \r
+                                   If this parameter is not NULL and the first Device Path Node is \r
+                                   not the End of Device Path Node, then only the handle for the \r
+                                   child device specified by the first Device Path Node of \r
+                                   RemainingDevicePath is created by this driver.\r
+                                   If the first Device Path Node of RemainingDevicePath is \r
+                                   the End of Device Path Node, no child handle is created by this\r
+                                   driver.\r
+\r
+  @retval EFI_SUCCESS              The device was started.\r
+  @retval EFI_DEVICE_ERROR         The device could not be started due to a device error. Currently not implemented.\r
+  @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of resources.\r
+  @retval Others                   The driver failed to start the device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
+  );\r
+\r
+/**\r
+  Stops a device controller or a bus controller.\r
+  \r
+  The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
+  As a result, much of the error checking on the parameters to Stop() has been moved \r
+  into this common boot service. It is legal to call Stop() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
+     same driver's Start() function.\r
+  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
+     EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
+     Start() function, and the Start() function must have called OpenProtocol() on\r
+     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
+  \r
+  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
+                                support a bus specific I/O protocol for the driver \r
+                                to use to stop the device.\r
+  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+                                if NumberOfChildren is 0.\r
+\r
+  @retval EFI_SUCCESS           The device was stopped.\r
+  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiDriverBindingStop (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN UINTN                        NumberOfChildren,\r
+  IN EFI_HANDLE                   *ChildHandleBuffer OPTIONAL\r
+  );\r
+\r
+//\r
+// EFI Component Name(2) Protocol for iSCSI driver.\r
+//\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[in]  This              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param[in]  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[out]  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
+IScsiComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL   *This,\r
+  IN  CHAR8                         *Language,\r
+  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[in]  This              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param[in]  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[in]  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[in]  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 \r
+                                determined by the driver writer. Language is \r
+                                specified inRFC 4646 or ISO 639-2 language code \r
+                                format.\r
+                                \r
+  @param[out]  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
+IScsiComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL   *This,\r
+  IN  EFI_HANDLE                    ControllerHandle,\r
+  IN  EFI_HANDLE                    ChildHandle        OPTIONAL,\r
+  IN  CHAR8                         *Language,\r
+  OUT CHAR16                        **ControllerName\r
+  );\r
+\r
+//\r
+// EFI iSCSI Initiator Name Protocol for iSCSI driver.\r
+//\r
+\r
+/**\r
+  Retrieves the current set value of iSCSI Initiator Name.\r
+\r
+  @param[in]       This          Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL\r
+                                 instance.\r
+  @param[in, out]  BufferSize    Size of the buffer in bytes pointed to by Buffer /\r
+                                 Actual size of the variable data buffer.\r
+  @param[out]      Buffer        Pointer to the buffer for data to be read.\r
+\r
+  @retval EFI_SUCCESS            Data was successfully retrieved into the provided\r
+                                 buffer and the BufferSize was sufficient to handle\r
+                                 the iSCSI initiator name.\r
+  @retval EFI_BUFFER_TOO_SMALL   BufferSize is too small for the result. BufferSize\r
+                                 will be updated with the size required to complete\r
+                                 the request. Buffer will not be affected.\r
+  @retval EFI_INVALID_PARAMETER  BufferSize is NULL. BufferSize and Buffer will not\r
+                                 be affected.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL. BufferSize and Buffer will not be\r
+                                 affected.\r
+  @retval EFI_DEVICE_ERROR       The iSCSI initiator name could not be retrieved\r
+                                 due to a hardware error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiGetInitiatorName (\r
+  IN     EFI_ISCSI_INITIATOR_NAME_PROTOCOL  *This,\r
+  IN OUT UINTN                              *BufferSize,\r
+  OUT    VOID                               *Buffer\r
+  );\r
+\r
+/**\r
+  Sets the iSSI Initiator Name.\r
+\r
+  @param[in]       This          Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL\r
+                                 instance.\r
+  @param[in, out]  BufferSize    Size of the buffer in bytes pointed to by Buffer.\r
+  @param[in]       Buffer        Pointer to the buffer for data to be written.\r
+\r
+  @retval EFI_SUCCESS            Data was successfully stored by the protocol.\r
+  @retval EFI_UNSUPPORTED        Platform policies do not allow for data to be\r
+                                 written.\r
+  @retval EFI_INVALID_PARAMETER  BufferSize exceeds the maximum allowed limit.\r
+                                 BufferSize will be updated with the maximum size\r
+                                 required to complete the request.\r
+  @retval EFI_INVALID_PARAMETER  Buffersize is NULL. BufferSize and Buffer will not\r
+                                 be affected.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL. BufferSize and Buffer will not be\r
+                                 affected.\r
+  @retval EFI_DEVICE_ERROR       The data could not be stored due to a hardware\r
+                                 error.\r
+  @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the data\r
+  @retval EFI_PROTOCOL_ERROR     Input iSCSI initiator name does not adhere to RFC\r
+                                 3720\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiSetInitiatorName (\r
+  IN     EFI_ISCSI_INITIATOR_NAME_PROTOCOL  *This,\r
+  IN OUT UINTN                              *BufferSize,\r
+  IN     VOID                               *Buffer\r
+  );\r
+\r
+//\r
+// EFI_AUTHENTICATION_INFO_PROTOCOL for iSCSI driver.\r
+//\r
+\r
+/**\r
+  Retrieves the authentication information associated with a particular controller handle.\r
+\r
+  @param[in]  This              Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
+  @param[in]  ControllerHandle  Handle to the Controller.\r
+  @param[out] Buffer            Pointer to the authentication information. This function is\r
+                                responsible for allocating the buffer and it is the caller's\r
+                                responsibility to free buffer when the caller is finished with buffer.\r
+\r
+  @retval EFI_DEVICE_ERROR      The authentication information could not be\r
+                                retrieved due to a hardware error.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiGetAuthenticationInfo (\r
+  IN  EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
+  IN  EFI_HANDLE                       ControllerHandle,\r
+  OUT VOID                             **Buffer\r
+  );\r
+\r
+/**\r
+  Set the authentication information for a given controller handle.\r
+\r
+  @param[in]  This             Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL.\r
+  @param[in]  ControllerHandle Handle to the Controller.\r
+  @param[in]  Buffer           Pointer to the authentication information.\r
+\r
+  @retval EFI_UNSUPPORTED      If the platform policies do not allow setting of\r
+                               the authentication information.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiSetAuthenticationInfo (\r
+  IN EFI_AUTHENTICATION_INFO_PROTOCOL  *This,\r
+  IN EFI_HANDLE                        ControllerHandle,\r
+  IN VOID                              *Buffer\r
+  );\r
+\r
+//\r
+// EFI_EXT_SCSI_PASS_THRU_PROTOCOL for iSCSI driver.\r
+//\r
+\r
+/**\r
+  Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.\r
+  This function supports both blocking I/O and nonblocking I/O. The blocking I/O\r
+  functionality is required, and the nonblocking I/O functionality is optional.  \r
+\r
+  @param[in]       This    A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param[in]       Target  The Target is an array of size TARGET_MAX_BYTES and it\r
+                           represents the id of the SCSI device to send the SCSI\r
+                           Request Packet. Each transport driver may choose to\r
+                           utilize a subset of this size to suit the needs\r
+                           of transport target representation. For example, a \r
+                           Fibre Channel driver may use only 8 bytes (WWN)\r
+                           to represent an FC target.\r
+  @param[in]       Lun     The LUN of the SCSI device to send the SCSI Request Packet.\r
+  @param[in, out]  Packet  A pointer to the SCSI Request Packet to send to the\r
+                           SCSI device specified by Target and Lun.                  \r
+  @param[in]       Event   If nonblocking I/O is not supported then Event is ignored,\r
+                           and blocking I/O is performed. If Event is NULL, then\r
+                           blocking I/O is performed. If Event is not NULL and non\r
+                           blocking I/O is supported, then nonblocking I/O is performed,\r
+                           and Event will be signaled when the SCSI Request Packet\r
+                           completes.\r
+\r
+  @retval EFI_SUCCESS           The SCSI Request Packet was sent by the host. For\r
+                                bi-directional commands, InTransferLength bytes \r
+                                were transferred from InDataBuffer.\r
+                                For write and bi-directional commands, OutTransferLength\r
+                                bytes were transferred by OutDataBuffer.\r
+  @retval EFI_BAD_BUFFER_SIZE   The SCSI Request Packet was not executed.\r
+                                The number of bytes that could be transferred is\r
+                                returned in InTransferLength. For write and\r
+                                bi-directional commands, OutTransferLength bytes\r
+                                were transferred by OutDataBuffer.\r
+  @retval EFI_NOT_READY         The SCSI Request Packet could not be sent because\r
+                                there are too many SCSI Request Packets already\r
+                                queued. The caller may retry later.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to send\r
+                                the SCSI Request Packet.                                \r
+  @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket\r
+                                are invalid.\r
+  @retval EFI_UNSUPPORTED       The command described by the SCSI Request Packet\r
+                                is not supported by the host adapter.\r
+                                This includes the case of Bi-directional SCSI\r
+                                commands not supported by the implementation.\r
+                                The SCSI Request Packet was not sent,\r
+                                so no additional status information is available.\r
+  @retval EFI_TIMEOUT           A timeout occurred while waiting for the SCSI\r
+                                Request Packet to execute.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruFunction (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL                          *This,\r
+  IN UINT8                                                    *Target,\r
+  IN UINT64                                                   Lun,\r
+  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET           *Packet,\r
+  IN EFI_EVENT                                                Event     OPTIONAL\r
+  );\r
+\r
+/**\r
+  Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on\r
+  a SCSI channel. These can either be the list SCSI devices that are actually\r
+  present on the SCSI channel, or the list of legal Target Ids and LUNs for the\r
+  SCSI channel. Regardless, the caller of this function must probe the Target ID      \r
+  and LUN returned to see if a SCSI device is actually present at that location    \r
+  on the SCSI channel. \r
+\r
+  @param[in]       This          The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param[in, out]  Target        On input, a pointer to the Target ID of a SCSI\r
+                                 device present on the SCSI channel.  On output, a\r
+                                 pointer to the Target ID of the next SCSI device\r
+                                 present on a SCSI channel.  An input value of\r
+                                 0xFFFFFFFF retrieves the Target ID of the first\r
+                                 SCSI device present on a SCSI channel.\r
+  @param[in, out]  Lun           On input, a pointer to the LUN of a SCSI device\r
+                                 present on the SCSI channel. On output, a pointer\r
+                                 to the LUN of the next SCSI device present on a\r
+                                 SCSI channel.\r
+\r
+  @retval EFI_SUCCESS            The Target ID and Lun of the next SCSI device  on\r
+                                 the SCSI channel was returned in Target and Lun.\r
+  @retval EFI_NOT_FOUND          There are no more SCSI devices on this SCSI\r
+                                 channel.\r
+  @retval EFI_INVALID_PARAMETER  Target is not 0xFFFFFFFF,and Target and Lun were\r
+                                 not returned on a previous call to\r
+                                 GetNextDevice().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruGetNextTargetLun (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
+  IN OUT UINT8                        **Target,\r
+  IN OUT UINT64                       *Lun\r
+  );\r
+\r
+/**\r
+  Allocate and build a device path node for a SCSI device on a SCSI channel.\r
+\r
+  @param[in]       This          Protocol instance pointer.\r
+  @param[in]       Target        The Target ID of the SCSI device for which a\r
+                                 device path node is to be allocated and built.\r
+  @param[in]       Lun           The LUN of the SCSI device for which a device\r
+                                 path node is to be allocated and built.\r
+  @param[in, out]  DevicePath    A pointer to a single device path node that\r
+                                 describes the SCSI device specified by  Target and\r
+                                 Lun. This function is responsible  for allocating\r
+                                 the buffer DevicePath with the boot service\r
+                                 AllocatePool().  It is the caller's\r
+                                 responsibility to free DevicePath when the caller\r
+                                 is finished with DevicePath.\r
+\r
+  @retval EFI_SUCCESS            The device path node that describes the SCSI\r
+                                 device specified by Target and Lun was allocated\r
+                                 and  returned in DevicePath.\r
+  @retval EFI_NOT_FOUND          The SCSI devices specified by Target and Lun does\r
+                                 not exist on the SCSI channel.\r
+  @retval EFI_INVALID_PARAMETER  DevicePath is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   There are not enough resources to allocate\r
+                                 DevicePath.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruBuildDevicePath (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
+  IN UINT8                            *Target,\r
+  IN UINT64                           Lun,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL     **DevicePath\r
+  );\r
+\r
+/**\r
+  Translate a device path node to a Target ID and LUN.\r
+\r
+  @param[in]   This              Protocol instance pointer.\r
+  @param[in]   DevicePath        A pointer to the device path node that  describes\r
+                                 a SCSI device on the SCSI channel.\r
+  @param[out]  Target            A pointer to the Target ID of a SCSI device  on\r
+                                 the SCSI channel.\r
+  @param[out]  Lun               A pointer to the LUN of a SCSI device on  the SCSI\r
+                                 channel.\r
+\r
+  @retval EFI_SUCCESS            DevicePath was successfully translated to a\r
+                                 Target ID and LUN, and they were returned  in\r
+                                 Target and Lun.\r
+  @retval EFI_INVALID_PARAMETER  DevicePath/Target/Lun is NULL.\r
+  @retval EFI_UNSUPPORTED        This driver does not support the device path node\r
+                                 type in DevicePath.\r
+  @retval EFI_NOT_FOUND          A valid translation from DevicePath to a  Target\r
+                                 ID and LUN does not exist.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruGetTargetLun (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
+  IN EFI_DEVICE_PATH_PROTOCOL         *DevicePath,\r
+  OUT UINT8                           **Target,\r
+  OUT UINT64                          *Lun\r
+  );\r
+\r
+/**\r
+  Resets a SCSI channel.This operation resets all the SCSI devices connected to\r
+  the SCSI channel.\r
+\r
+  @param[in]  This               Protocol instance pointer.\r
+\r
+  @retval EFI_UNSUPPORTED        It is not supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruResetChannel (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Resets a SCSI device that is connected to a SCSI channel.\r
+\r
+  @param[in]  This               Protocol instance pointer.\r
+  @param[in]  Target             The Target ID of the SCSI device to reset.\r
+  @param[in]  Lun                The LUN of the SCSI device to reset.\r
+\r
+  @retval EFI_UNSUPPORTED        It is not supported.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruResetTargetLun (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
+  IN UINT8                            *Target,\r
+  IN UINT64                           Lun\r
+  );\r
+\r
+/**\r
+  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.                         \r
+\r
+  @param[in]       This         A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL\r
+                                instance.\r
+  @param[in, out]  Target       (TARGET_MAX_BYTES) of a SCSI device present on\r
+                                the SCSI channel. On output, a pointer to the\r
+                                Target ID (an array of TARGET_MAX_BYTES) of the\r
+                                next SCSI device present on a SCSI channel.\r
+                                An input value of 0xF(all bytes in the array are 0xF)\r
+                                in the Target array retrieves the Target ID of the\r
+                                first SCSI device present on a SCSI channel.                 \r
+\r
+  @retval EFI_SUCCESS           The Target ID of the next SCSI device on the SCSI\r
+                                channel was returned in Target.\r
+  @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r
+  @retval EFI_TIMEOUT           Target array is not all 0xF, and Target was not\r
+                                returned on a previous call to GetNextTarget().\r
+  @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruGetNextTarget (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
+  IN OUT UINT8                        **Target\r
+  );\r
+\r
+#endif\r