-/*++\r
+/** @file\r
+ The IScsi's EFI_EXT_SCSI_PASS_THRU_PROTOCOL driver\r
\r
Copyright (c) 2004 - 2007, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
IScsiExtScsiPassThru.c\r
\r
Abstract:\r
+ The IScsi's EFI_EXT_SCSI_PASS_THRU_PROTOCOL driver\r
\r
---*/\r
+**/\r
\r
#include "IScsiImpl.h"\r
\r
+/**\r
+ This function sends out the SCSI command via iSCSI transport layer and returned\r
+ back the data received from the iSCSI target. \r
+\r
+ @param This[in] The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+\r
+ @param Target[in] The Target ID of device to send the SCSI Request Packet. \r
+\r
+ @param Lun[in] The LUN of the device to send the SCSI Request Packet.\r
+\r
+ @param Packet[in][out] The SCSI Request Packet to send to the device.\r
+\r
+ @param Event[in] The event used in non-blocking mode, it should be always NULL.\r
+\r
+ @retval EFI_STATUS\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IScsiExtScsiPassThruFunction (\r
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r
IN EFI_EVENT Event OPTIONAL\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- This function sends out the SCSI command via iSCSI transport layer and returned\r
- back the data received from the iSCSI target. \r
-\r
-Arguments:\r
-\r
- This - The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
- Target - The Target ID of device to send the SCSI Request Packet. \r
- Lun - The LUN of the device to send the SCSI Request Packet.\r
- Packet - The SCSI Request Packet to send to the device.\r
- Event - The event used in non-blocking mode, it should be always NULL.\r
-\r
-Returns:\r
-\r
- EFI_STATUS\r
-\r
---*/\r
{\r
if (Target[0] != 0) {\r
return EFI_INVALID_PARAMETER;\r
return IScsiExecuteScsiCommand (This, Target, Lun, Packet);\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
+ Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
\r
-Routine Description:\r
+ @param This[in] The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
\r
- Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
+ @param Target[in][out] On input, a pointer to the Target ID of a SCSI device present on the\r
+ SCSI channel. On output, a pointer to the Target ID of the next SCSI\r
+ device present on a SCSI channel. An input value of 0xFFFFFFFF retrieves\r
+ the Target ID of the first SCSI device present on a SCSI channel.\r
\r
-Arguments:\r
+ @param Lun[in][out] On input, a pointer to the LUN of a SCSI device present on the SCSI\r
+ channel. On output, a pointer to the LUN of the next SCSI device\r
+ present on a SCSI channel.\r
\r
- This - The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance..\r
- Target - On input, a pointer to the Target ID of a SCSI device present on the\r
- SCSI channel. On output, a pointer to the Target ID of the next SCSI\r
- device present on a SCSI channel. An input value of 0xFFFFFFFF\r
- retrieves the Target ID of the first SCSI device present on a SCSI channel.\r
- Lun - On input, a pointer to the LUN of a SCSI device present on the SCSI\r
- channel. On output, a pointer to the LUN of the next SCSI device present on \r
- a SCSI channel.\r
+ @retval EFI_SUCCESS The Target ID and Lun of the next SCSI device \r
+ on the SCSI channel was returned in Target and Lun.\r
\r
-Returns:\r
+ @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r
\r
- EFI_SUCCESS - The Target ID and Lun of the next SCSI device \r
- on the SCSI channel was returned in Target and Lun.\r
- EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.\r
- EFI_INVALID_PARAMETER - Target is not 0xFFFFFFFF,and Target and Lun were not\r
- returned on a previous call to GetNextDevice().\r
+ @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were not\r
+ returned on a previous call to GetNextDevice().\r
\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
ISCSI_DRIVER_DATA *Private;\r
ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+/**\r
+ Allocate and build a device path node for a SCSI device on a SCSI channel.\r
+\r
+ @param This[in] Protocol instance pointer.\r
+\r
+ @param Target[in] The Target ID of the SCSI device for which\r
+ a device path node is to be allocated and built.\r
+\r
+ @param Lun[in] The LUN of the SCSI device for which a device \r
+ path node is to be allocated and built.\r
+\r
+ @param DevicePath[in][out] A pointer to a single device path node that \r
+ describes the SCSI device specified by \r
+ Target and Lun. This function is responsible \r
+ for allocating the buffer DevicePath with the boot\r
+ service 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 device\r
+ specified by Target and Lun was allocated and \r
+ returned in DevicePath.\r
+\r
+ @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does\r
+ not exist on the SCSI channel.\r
+\r
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
+\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 UINT64 Lun,\r
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocate and build a device path node for a SCSI device on a SCSI channel.\r
-\r
-Arguments:\r
-\r
- This - Protocol instance pointer.\r
- Target - The Target ID of the SCSI device for which\r
- a device path node is to be allocated and built.\r
- Lun - The LUN of the SCSI device for which a device \r
- path node is to be allocated and built.\r
- DevicePath - A pointer to a single device path node that \r
- describes the SCSI device specified by \r
- Target and Lun. This function is responsible \r
- for allocating the buffer DevicePath with the boot\r
- service AllocatePool(). It is the caller's \r
- responsibility to free DevicePath when the caller\r
- is finished with DevicePath. \r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The device path node that describes the SCSI device\r
- specified by Target and Lun was allocated and \r
- returned in DevicePath.\r
- EFI_NOT_FOUND - The SCSI devices specified by Target and Lun does\r
- not exist on the SCSI channel.\r
- EFI_INVALID_PARAMETER - DevicePath is NULL.\r
- EFI_OUT_OF_RESOURCES - There are not enough resources to allocate \r
- DevicePath.\r
-\r
---*/\r
{\r
ISCSI_DRIVER_DATA *Private;\r
ISCSI_SESSION *Session;\r
\r
Node->DevPath.Type = MESSAGING_DEVICE_PATH;\r
Node->DevPath.SubType = MSG_ISCSI_DP;\r
- SetDevicePathNodeLength (&Node->DevPath, DevPathNodeLen);\r
+ SetDevicePathNodeLength (&Node->DevPath, (UINT16)DevPathNodeLen);\r
\r
//\r
// 0 for TCP, others are reserved.\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Translate a device path node to a Target ID and LUN.\r
+\r
+ @param This[in] Protocol instance pointer.\r
+\r
+ @param DevicePath[in] A pointer to the device path node that \r
+ describes a SCSI device on the SCSI channel.\r
+\r
+ @param Target[out] A pointer to the Target ID of a SCSI device \r
+ on the SCSI channel. \r
+\r
+ @param Lun[out] A pointer to the LUN of a SCSI device on \r
+ the SCSI channel. \r
+\r
+ @retval EFI_SUCCESS DevicePath was successfully translated to a \r
+ Target ID and LUN, and they were returned \r
+ in Target and Lun.\r
+\r
+ @retval EFI_INVALID_PARAMETER DevicePath/Target/Lun is NULL.\r
+\r
+ @retval EFI_UNSUPPORTED This driver does not support the device path \r
+ node type in DevicePath.\r
+\r
+ @retval EFI_NOT_FOUND A valid translation from DevicePath to a \r
+ Target ID and LUN does not exist.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IScsiExtScsiPassThruGetTargetLun (\r
OUT UINT8 **Target,\r
OUT UINT64 *Lun\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Translate a device path node to a Target ID and LUN.\r
-\r
-Arguments:\r
-\r
- This - Protocol instance pointer.\r
- DevicePath - A pointer to the device path node that \r
- describes a SCSI device on the SCSI channel.\r
- Target - A pointer to the Target ID of a SCSI device \r
- on the SCSI channel. \r
- Lun - A pointer to the LUN of a SCSI device on \r
- the SCSI channel. \r
-Returns:\r
-\r
- EFI_SUCCESS - DevicePath was successfully translated to a \r
- Target ID and LUN, and they were returned \r
- in Target and Lun.\r
- EFI_INVALID_PARAMETER - DevicePath/Target/Lun is NULL.\r
- EFI_UNSUPPORTED - This driver does not support the device path \r
- node type in DevicePath.\r
- EFI_NOT_FOUND - A valid translation from DevicePath to a \r
- Target ID and LUN does not exist.\r
-\r
---*/\r
{\r
ISCSI_DRIVER_DATA *Private;\r
ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Resets a SCSI channel.This operation resets all the SCSI devices connected to\r
+ the SCSI channel.\r
+\r
+ @param This[in] Protocol instance pointer.\r
+\r
+ @retval EFI_UNSUPPORTED It's not supported.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IScsiExtScsiPassThruResetChannel (\r
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Resets a SCSI channel.This operation resets all the SCSI devices connected to\r
- the SCSI channel.\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
\r
-Arguments:\r
+/**\r
+ Resets a SCSI device that is connected to a SCSI channel.\r
\r
- This - Protocol instance pointer.\r
+ @param This[in] Protocol instance pointer.\r
\r
-Returns:\r
+ @param Target[in] The Target ID of the SCSI device to reset.\r
\r
- EFI_UNSUPPORTED - It's not supported.\r
+ @param Lun[in] The LUN of the SCSI device to reset.\r
\r
---*/\r
-{\r
- return EFI_UNSUPPORTED;\r
-}\r
+ @retval EFI_UNSUPPORTED It's not supported.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
IScsiExtScsiPassThruResetTargetLun (\r
IN UINT8 *Target,\r
IN UINT64 Lun\r
)\r
-/*++\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
\r
-Routine Description:\r
+/**\r
+ Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
\r
- Resets a SCSI device that is connected to a SCSI channel.\r
+ @param This[in] Protocol instance pointer.\r
\r
-Arguments:\r
+ @param Target[in] On input, a pointer to the Target ID of a SCSI \r
+ device present on the SCSI channel. On output, \r
+ a 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
\r
- This - Protocol instance pointer.\r
- Target - The Target ID of the SCSI device to reset. \r
- Lun - The LUN of the SCSI device to reset.\r
- \r
-Returns:\r
+ @retval EFI_SUCCESS The Target ID and Lun of the next SCSI device \r
+ on the SCSI channel was returned in Target and Lun.\r
\r
- EFI_UNSUPPORTED - It's not supported.\r
+ @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r
\r
---*/\r
-{\r
- return EFI_UNSUPPORTED;\r
-}\r
+ @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were not\r
+ returned on a previous call to GetNextDevice().\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
-\r
-Routine Description:\r
-\r
- Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
-\r
-Arguments:\r
- This - Protocol instance pointer.\r
- Target - On input, a pointer to the Target ID of a SCSI \r
- device present on the SCSI channel. On output, \r
- a 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
- 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 \r
- a SCSI channel.\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - The Target ID and Lun of the next SCSI device \r
- on the SCSI channel was returned in Target and Lun.\r
- EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.\r
- EFI_INVALID_PARAMETER - Target is not 0xFFFFFFFF,and Target and Lun were not\r
- returned on a previous call to GetNextDevice().\r
-\r
---*/\r
{\r
UINT8 TargetId[TARGET_MAX_BYTES];\r
\r