HBA_ScsiInquiryV2 Subroutine

Purpose

Sends a SCSI INQUIRY command to a remote end port.

Syntax

HBA_STATUS HBA_ScsiInquiryV2 (
		HBA_HANDLE handle,
		HBA_WWN hbaPortWWN,
		HBA_WWN discoveredPortWWN,
		HBA_UINT64 fcLUN,
		HBA_UINT8 CDB_Byte1,
		HBA_UINT8 CDB_Byte2,
		void *pRspBuffer,
		HBA_UINT32 *pRspBufferSize,
		HBA_UINT8 *pScsiStatus,
		void *pSenseBuffer,
		HBA_UINT32 *pSenseBufferSize
);

Description

The HBA_ScsiInquiryV2 function sends a SCSI INQUIRY command to a remote end port.

A SCSI command is never sent to an end port that does not have SCSI target functionality. If sending a SCSI command causes a SCSI overlapped command condition with a correctly operating target, the command does not get sent. Proper use of tagged commands is an acceptable means of avoiding a SCSI overlapped command condition with targets that support tagged commands.

Parameters

Item Description
handle Open HBA through which the SCSI INQUIRY command can be issued.
hbaPortWWN The Port Name for a local HBA end port through which the SCSI INQUIRY command can be issued.
discoveredPortWWN The Port Name for an end port to which the SCSI INQUIRY command can be sent.
fcLUN The SCSI LUN to which the SCSI INQUIRY command can be sent.
CDB_Byte1 The second byte of the CDB for the SCSI INQUIRY command. This contains control flag bits. At the time this standard was written, the effects of the value of CDB_Byte1 on a SCSI INQUIRY command were as follows:
  • 0
    • Requests the standard SCSI INQUIRY data.
  • 1
    • Requests the vital product data (EVPD) specified by CDB_Byte2.
  • 2
    • Requests command support data (CmdDt) for the command specified in CDB_Byte2.
  • Other values
    • Can cause SCSI Check Condition.
CDB_Byte2 The third byte of the CDB for the SCSI INQUIRY command. If CDB_Byte1 is 1, CDB_Byte2 is the Vital Product Data page code to request. If CDB_Byte1 is 2, CDB_Byte2 is the Operation Code of the command support data requested. For other values of CDB_Byte1, the value of CDB_Byte2 is unspecified, and values other than 0 can cause a SCSI Check Condition.
pRspBuffer A pointer to a buffer to receive the SCSI INQUIRY command response.
pRspBufferSize A pointer to the size in bytes of the buffer to receive the SCSI INQUIRY command response.
pScsiStatus A pointer to a buffer to receive SCSI status.
pSenseBuffer A pointer to a buffer to receive SCSI sense data.
pSenseBufferSize A pointer to the size in bytes of the buffer to receive SCSI sense data.

Return Values

The value of the HBA_ScsiInquiryV2 function is a valid status return value that indicates the reason for completion of the requested function. HBA_STATUS_OK is returned to indicate that the complete payload of a reply to the SCSI INQUIRY command has been returned. A valid status return value that most closely describes the result of the function should be returned to indicate a reason with no required value.

The return values for the following parameters are as follows:

Item Description
pRspBuffer Remains unchanged. If the function value is HBA_STATUS_OK, the buffer to which it points contains the response to the SCSI INQUIRY command.
pRspBufferSize Remains unchanged. The value of the integer to which it points is the size in bytes of the response returned by the command. This cannot exceed the size passed as an argument at this pointer.
pScsiStatus Remains unchanged. The value of the byte to which it points is the SCSI status. If the function value is HBA_STATUS_OK or HBA_STATUS_SCSI_CHECK_CONDITION, the value of the SCSI status can be interpreted based on the SCSI spec. A SCSI status of HBA_STATUS_OK indicates that a SCSI response is in the response buffer. A SCSI status of HBA_STATUS_SCSI_CHECK_CONDITION indicates that no value is stored in the response, and the sense buffer contains failure information if available.
pSenseBuffer Remains unchanged. If the function value is HBA_STATUS_SCSI_CHECK_CONDITION, the buffer to which it points contains the sense data for the command.
pSenseBufferSize Remains unchanged. The value of the integer to which it points is the size in bytes of the sense information returned by the command. This cannot exceed the size passed as an argument at this pointer.

Error Codes

Item Description
HBA_STATUS_ERROR_ILLEGAL_WWN The HBA referenced by handle does not contain an end port with Port Name hbaPortWWN.
HBA_STATUS_ERROR_NOT_A_TARGET The identified remote end port does not have SCSI Target functionality.
HBA_STATUS_ERROR_TARGET_BUSY Unable to send the requested command without causing a SCSI overlapped command condition.
HBA_STATUS_ERROR Returned to indicate any problem with no required value.