[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

HBA_SendReportLUNs Subroutine

Purpose

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

Library

Common Host Bus Adapter Library (libHBAAPI.a)

Syntax

#include <hbaapi.h>

HBA_STATUS HBA_SendReportLUNs (handle, PortWWN, pRspBuffer, RspBufferSize, pSenseBuffer, SenseBufferSize)
HBA_HANDLE handle;
HBA_WWN PortWWN;
void *pRspBuffer;
HBA_UINT32 RspBufferSize;
void *pSenseBuffer;
HBA_UINT32 SenseBufferSize;

Description

The HBA_SendReportLUNs subroutine sends a SCSI REPORT LUNs command through a call to ioctl with the SCIOLCMD operation as its argument. The arg parameter for the SCIOLCMD operation is the address of a scsi_iocmd structure. This structure is defined in the /usr/include/sys/scsi_buf.h file. The scsi_iocmd parameter block allows the caller to select the SCSI and LUN IDs to be queried. The caller also specifies the SCSI command descriptor block area, command length (SCSI command block length), the time-out value for the command, and a flags field.

If successful, the report LUNs data is returned in pRspBuffer. The returned report LUNs data must be examined to see if the requested LUN exists.

Parameters

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.
pRspBuffer Points to a buffer containing the requested instruction for a send/read capacity request to an open adapter.
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_SendReportLUNs subroutine returns a buffer in bytes containing the SCSI report of LUNs, 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 report of LUNs, 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:

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_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.

Related Information

HBA_SendScsiInquiry Subroutine, HBA_SendReadCapacity Subroutine, HBA_SendCTPassThru Subroutine, HBA_SendRNID Subroutine, HBA_SetRNIDMgmtInfo Subroutine, and HBA_GetRNIDMgmtInfo Subroutine.

SCSI Adapter Device Driver in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 2.

Special Files in AIX 5L Version 5.2 Files Reference.

SCSI Subsystem Overview, A Typical Initiator-Mode SCSI Driver Transaction Sequence, Required SCSI Adapter Device Driver ioctl Commands, Understanding the Execution of Initiator I/O Requests, SCSI Error Recovery, and Understanding the sc_buf Structure in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]