Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Thursday, June 13, 2019
 
 

IMA_LuInquiry (3IMA)

Name

IMA_LuInquiry - Gets the specified SCSI INQUIRY data for a specified logical unit

Synopsis

cc [ flag... ] file... -lima [ library... ]
#include <ima.h>

IMA_STATUS IMA_LuInquiry(
    /* in */       IMA_OID deviceOid,
    /* in */       IMA_BOOL evpd,
    /* in */       IMA_BOOL cmddt,
    /* in */       IMA_BYTE pageCode,
    /* out */      IMA_BYTE *pOutputBuffer,
    /* in, out */ IMA_UINT *pOutputBufferLength,
    /* out */      IMA_BYTE *pSenseBuffer,
    /* in, out */ IMA_UINT *pSenseBufferLength
);

Parameters

deviceOid

The object ID of the target or logical unit (LU) whose SCSI INQUIRY data is to be retrieved. If the object ID specifies a target, then the command will be sent to LUN 0 of the target.

evpd

A boolean indicating if the EVPD bit is set.

cmddt

A boolean indicating if the CMDDT bit is set.

pageCode

The value to be placed in the page or the operation code byte.

pOutputBuffer

A pointer to the memory location, which, on successful completion contains the data returned by the logical unit.

pOutputBufferLength

On entry, this argument points to the length, in bytes, of the memory area specified by the pOutputBuffer argument.

If returned successfully, this argument points to the number of bytes that were placed into the output buffer.

pSenseBuffer

A pointer to a memory location, which, if the SCSI INQUIRY command fails with a CHECK CONDITION status, contains the sense data received from the logical unit.

If this parameter is NULL, no sense data will be transferred to the client if the SCSI INQUIRY command fails with a CHECK CONDITION status.

pSenseBufferLength

A pointer to the sense buffer length. On entry to the function, this argument points to a variable containing the maximum length, in bytes, of the pSenseBuffer argument.

If the API returns the value, IMA_ERROR_SCSI_STATUS_CHECK_CONDITION, then, on exit, the pSenseBufferLength argument contains the number of sense data bytes returned in the pSenseBuffer argument.

If the pSenseBuffer argument is NULL, then the pSenseBufferLength argument value is 0. If any other value is returned by the API, then, on exit this value remains the same as on entry.

Description

The IMA_LuInquiry() API gets the specified SCSI INQUIRY data for a specified logical unit.

Return Values

IMA_ERROR_INVALID_PARAMETER
  • Returned if the pOutputBuffer argument is NULL, or specifies a memory area to which the pOutputBufferLength argument bytes cannot be written.

  • Returned if the pOutputBufferLength argument is 0.

  • Returned if the pSenseBufferLength argument is greater than zero and the pSenseBuffer argument specifies a memory area to which the pSenseBufferLength argument bytes cannot be written.

  • Returned if the evpd or cmddt argument have a value other than the value, IMA_TRUE or the value, IMA_FALSE.

IMA_ERROR_INVALID_OBJECT_TYPE

Returned if the deviceOid argument does not specify a valid object type.

IMA_ERROR_INCORRECT_OBJECT_TYPE

Returned if the deviceOid argument does not specify a target or LU object.

IMA_ERROR_OBJECT_NOT_FOUND

Returned if the deviceOid argument does not specify a target or LU known to the system.

IMA_ERROR_SCSI_STATUS_CHECK_CONDITION

Returned if the SCSI INQUIRY command failed with a CHECK CONDITION status. If this value is returned, and if the pSenseBuffer argument is not NULL, it will contain the sense data returned by the logical unit.

IMA_ERROR_TARGET_TIMEOUT

Returned if the target associated with the specified LU failed to respond to an iSCSI login request from an initiator.

IMA_ERROR_LOGIN_REJECTED

Returned if the target associated with the specified LU rejected an iSCSI login request from an initiator.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library/storage/snia-ima
Interface Stability
Volatile
MT-Level
Safe

See Also

libima(3LIB), attributes(7), IMA_LuReadCapacity(3IMA), IMA_LuReportLuns(3IMA)