Fibre Channel SNIA HBA API Programmer's Guide

" time with single entry buffer\n");
if ((status =HBA_GetFcpPersistentBinding(adapterhandle,
&single_mapping)) == HBA_STATUS_ERROR_MROE_DATA)
{
printf("HBA_GetFcpPersistentBinding %d targets\n",
single_mapping.NumberOfEntries);
if (single_mapping.NumberOfEntries; > 0)
{
map_list = (PHBA_FCPBINDING) malloc
((single_mapping.NumberOfEntries;) *
sizeof(HBA_FCPBINDING) );
if (map_list)
{
map_list->NumberOfEntries =
single_mapping.NumberOfEntries;
printf ("calling HBA_GetFcpPersistentBinding\n");
if ((status =
HBA_GetFcpPersistentBinding(adapterhandle,
map_list)) != HBA_STATUS_OK)
{
printf("HBA_GetFcpPersistentBinding error"
" %d\n", status);
}
printf("HBA_GetFcpPersistentBinding returned %u targets
during second call with sufficient buffer\n",
map_list->NumberOfEntries);
} else
{
printf ("malloc failed\n");
}
}
} else
{
if (status != HBA_STATUS_OK)
{
printf("HBA_GetFcpPersistentBinding error %d\n",
status);
}
}
SCSI Informational Functions
These functions may be called to send SCSI commands to SCSI devices which have been mapped
behind FC interfaces. If the return status indicates success you may interpret the response buffer.
If the return status indicates a SCSI check condition you may have to interpret the sense buffer.
HBA_SendScsiInquiry
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_SendScsiInquiry(
HBA_HANDLE handle,
HBA_WWN port_wwn,
HBA_UINT64 fc_lun,
HBA_UINT8 evpd,
HBA_UINT32 page_code,
void *p_rsp_buffer,
HBA_UINT32 rsp_buffer_size,
void * p_sense_buffer,
30 HBA Common Library APIs