Fibre Channel SNIA HBA API Programmer's Guide
Example Code:
memset (resp_buffer, 0, sizeof(resp_buffer));
memset (sense_buffer, 0, sizeof(sense_buffer));
if ((status = HBA_SendScsiInquiry(adapter_handle, wwn,
fc_lun, evpd_reqd, page_code,
resp_buffer, sizeof(resp_buffer),
sense_buffer,
sizeof(sense_buffer))) != HBA_STATUS_OK)
{
printf ("HBA_SendScsiInquiry error %d\n", status);
} else
{
printf("HBA_SendScsiInquiry succeeded\n");
}
HBA_SendReportLUNs
NOTE: This function is meant to be called only by an application having an effective user id
as that of the super user (that is, effective user id = 0).
Function:
HBA_STATUS HBA_SendReportLUNs(
HBA_HANDLE handle,
HBA_WWN port_wwn,
void *p_rsp_buffer,
HBA_UINT32 rsp_buffer_size,
void *p_sense_buffer,
HBA_UINT32 sense_buffer_size
);
Purpose: Sends a SCSI REPORT LUNS command to a remote WWN.
Input Parameters: handle - Handle to an adapter already opened by a call to
HBA_OpenAdapter().
port_wwn - Port WWN of a remote port.
rsp_buffer_size - Size of buffer to receive the response.
sense_buffer_size - Size of buffer to receive sense data.
Output Parameters: p_rsp_buffer - Pointer to a buffer to receive response.
p_sense_buffer - Pointer to a buffer to receive sense data.
Return Values: Returned after a successful
execution of the call.
HBA_STATUS_OK
HBA_STATUS_ERROR
Returned when a internal
library or system error is
detected.
HBA_STATUS_ERROR_BUSY
Returned when the library is
busy and cannot currently
process this call.
HBA_STATUS_ERROR_INVALID_HANDLE
Returned when the handle
passed to this function is
invalid.
HBA_STATUS_ERROR_ARG
Returned when any of the
pointers passed to this
function are NULL.
HBA_STATUS_ERROR_UNAVAILABLE
Returned when the adapter
to which the handle
corresponds is not available.
32 HBA Common Library APIs