Fibre Channel SNIA HBA API Programmer's Guide
HBA_GetFcpPersistentBinding
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_GetFcpPersistentBinding(
HBA_HANDLE handle,
PHBA_FCPBINDING binding
);
Purpose: Gets persistent bindings between an FCP target and SCSI ID.
Input Parameters: handle - Handle to an adapter already opened by call to
HBA_OpenAdapter().binding - Pointer to an HBA_FCPBINDING
structure. The size of this structure is dependent on the
NumberOfEntries value within the structure and can be of
arbitrary size. To accommodate the entire mapping structure,
an upper level application can either allocate a sufficiently large
buffer and check this value after a read, or do a read of the
NumberOfEntries value separately and allocate a new buffer
given the size and repeat the call.
Output Parameters: binding - Pointer to an HBA_FCPBINDING structure.
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.
HBA_STATUS_ERROR_MORE_DATA
Returned when the
allocated buffer is
insufficient.
Call order sequence: See Appendix A.
Example code:
HBA_STATUS status;
HBA_HANDLE adapterhandle;
HBA_FCPBINDING single_mapping;
PHBA_FCPBINDING map_list
memset (&single_mapping, 0, sizeof(single_mapping));
single_mapping.NumberOfEntries = 1;
printf("Calling HBA_GetFcpPersistentBinding first"
FCP Information Functions 29