Fibre Channel SNIA HBA API Programmer's Guide

Return Values: Returned after a
successful execution of the
call.
HBA_STATUS_OK
HBA_STATUS_ERROR
Returned when an
internal library or system
error is detected.
HBA_STATUS_ERROR_ARG
Returned when the
pointer passed to this
function is NULL.
HBA_STATUS_ERROR_BUSY
Returned when the library
is busy and cannot
currently process this call.
HBA_STATUS_ERROR_UNAVAILABLE
Returned when the
adapter to the
corresponding handle is
not available.
HBA_STATUS_ERROR_ILLEGAL_INDEX
Returned when the
adapter_index is invalid.
Call order sequence: See Appendix A.
Example code:
HBA_UINT32 i;
HBA_STATUS status;
char adapter_name [256];
number_of_adapters = HBA_GetNumberOfAdapters();
for (i = 0; i < number_of_adapters; i++)
{
status = HBA_GetAdapterName(i, adapter_name);
if (status == HBA_STATUS_OK)
{
printf("Adapter %u is named %s\n",i, adapter_name); }
}
HBA_OpenAdapter
Function:
HBA_HANDLE HBA_OpenAdapter(
char *adapter_name
);
Purpose: Opens an adapter instance among multiple adapters being
handled by this library.
Input Parameters: adapter_name - Any name returned from a
HBA_GetAdapterName() call. Maximum length of the string
is 256 bytes.
Output Parameters: None.
Return Values: Handle to this opened adapter instance. This handle value is
unique from the user perspective for any adapter in the system
identified by the SNIA API common library. If any error occurs,
a handle value of 0 is returned. When a value of 0 is returned,
the errno variable should be interpreted as follows:
EINVAL = invalid argument passed
EBUSY = library is busy processing another call
EILSEQ = call made out-of-order
ENXIO = adapter is unavailable
14 HBA Common Library APIs