HBA_SendScsiInquiry Subroutine

Purpose

Sends a SCSI device inquiry command to a remote port of the end device.

Library

Common Host Bus Adapter Library (libHBAAPI.a)

Syntax

#include <sys/hbaapi.h>

HBA_STATUS HBA_SendScsiInquiry (handle, PortWWN, fcLUN, EVPD, PageCode, pRspBuffer, RspBufferSize, pSenseBuffer,
SenseBufferSize)
HBA_HANDLE handle;
HBA_WWN PortWWN;
HBA_UINT64 fcLUN;
HBA_UINT8 EVPD;
HBA_UINT32 PageCode;
void *pRspBuffer;
HBA_UINT32 RspBufferSize;
void *pSenseBuffer;
HBA_UINT32 SenseBufferSize;

Description

The HBA_SendScsiInquiry subroutine sends a SCSI INQUIRY command through a call to ioctl with the SCIOLINQU operation as its argument. The arg parameter for the SCIOLINQU operation is the address of an scsi_inquiry structure. This structure is defined in the /usr/include/sys/scsi_buf.h file. The scsi_inquiry parameter block allows the caller to select the SCSI and LUN IDs to be queried. If successful, the inquiry data is returned in the pRspBuffer parameter. Successful completion occurs if a device responds at the requested SCSI ID, but the returned inquiry data must be examined to see if the requested LUN exists.

Parameters

Item Description
handle Specifies the open file descriptor obtained from a successful call to the open subroutine.
PortWWN Specifies the world wide name or port name of the target device.
fcLUN Specifies the fcLUN.
EVPD Specifies the value for the EVPD bit. If the value is 1, the Vital Product Data page code will be specified by the PageCode parameter.
PageCode Specifies the Vital Product Data that is to be requested if the EVPD parameter is set to 1.
pRspBuffer Points to a buffer containing the requested instruction for a send/read capacity request to an open adapter. The size of this buffer must not be greater than 255 bytes.
RspBufferSize Specifies the size of the buffer to the pRspBuffer parameter.
pSenseBuffer Points to a buffer containing the data returned from a send/read capacity request to an open adapter.
SenseBufferSize Specifies the size of the buffer to the pSenseBuffer parameter.

Return Values

Upon successful completion, the HBA_SendScsiInquiry subroutine returns a buffer in bytes containing the SCSI inquiry, a buffer containing the SCSI sense data, and a value of HBA_STATUS_OK, or a value of 0.

If unsuccessful, an empty buffer for the SCSI inquiry, a response buffer containing the failure, and a value of HBA_STATUS_ERROR, or a value of 1 is returned.

Error Codes

The Storage Area Network Host Bus Adapter API subroutines return the following error codes:
Item Description
HBA_STATUS_OK A value of 0 on successful completion.
HBA_STATUS_ERROR A value of 1 if an error occurred.
HBA_STATUS_ERROR_INVALID_HANDLE A value of 3 if there was an invalid file handle.
HBA_STATUS_ERROR_ARG A value of 4 if there was a bad argument.
HBA_STATUS_ERROR_ILLEGAL_WWN A value of 5 if the world wide name was not recognized.
HBA_STATUS_SCSI_CHECK_CONDITION A value of 9 if a SCSI Check Condition was reported.