Fibre Channel SNIA HBA API Programmer's Guide

HBA_STATUS status;
status = HBA_FreeLibrary();
if (status == HBA_STATUS_OK)
{
printf("Successfully freed HBA library.\n");
}
HBA_GetNumberOfAdapters
Function:
HBA_UINT32 HBA_GetNumberOfAdapters();
Purpose: Returns the total number of adapters in the system. This function
is allowed to be called multiple times to handle OLAR.
Input Parameters: None.
Output Parameters: None.
Return Values: 32-bit unsigned integer value of total number of Fibre Channel
adapters claimed in the system. A value of 0 might be returned
for the following reasons:
an internal error has occurred
the library is busy
the number of adapters is 0
When a value of 0 is returned, the errno variable should be
interpreted as follows:
ENODEV = number of adapters in system is 0
EBUSY = library is busy processing another call
EILSEQ = call made out-of-order
EMFILES = too many files open
EIO = there is an internal error
Call order sequence: See Appendix A.
Example code:
HBA_UINT32 number_of_adapters;
HBA_STATUS status;
number_of_adapters = HBA_GetNumberOfAdapters();
printf("Number of adapters is %u\n",
number_of_adapters);
HBA_GetAdapterName
Function:
HBA_STATUS HBA_GetAdapterName(
HBA_UINT32 adapter_index,
char *adapter_name);
Purpose: Returns adapter name for a particular adapter instance referred
to by adapter_index.
NOTE: HBA_GetAdapterName does not verify card state.
Input Parameters: adapter_index - Index of the adapter among multiple adapters
being handled by this library. Valid range for this value is from
0 to 1 less than value returned from
HBA_GetNumberOfAdapters().
Output Parameters: adapter_name - Pointer to buffer returning the adapter name as
a string. The length of this buffer must be 256 bytes.
General Vendor Implemented Functions 13