Fibre Channel SNIA HBA API Programmer's Guide
• EACCES = there has been a file open error
• EIO = there is an internal error
Call order sequence: See Appendix A.
Example code:
HBA_HANDLE adapter_handle;
adapter_handle = HBA_OpenAdapter(adapter_name);
if (adapter_handle != 0)
{
printf ("Successfully opened %s\n", adapter_name);
}
HBA_CloseAdapter
Function:
void HBA_CloseAdapter(
HBA_HANDLE handle
);
Purpose: Closes the adapter corresponding to the input handle.
Input Parameters: handle - Handle to an adapter already opened by a call to
HBA_OpenAdapter().
Output Parameters: None.
Return Values: None.
Call order sequence: See Appendix A.
Example code:
HBA_UINT32 i;
HBA_STATUS status;
HBA_HANDLE adapter_handle;
char adapter_name [256];
HBA_UINT32 number_of_adapters;
status = HBA_LoadLibrary();
if (status == HBA_STATUS_OK)
{
printf("Successfully loaded HBA library.\n");
number_of_adapters = HBA_GetNumberOfAdapters();
for (i = 0; i < number_of_adapters; i++)
{
status = HBA_GetAdapterName (i, adapter_name);
if (status == HBA_STATUS_OK)
{
adapter_handle = HBA_OpenAdapter(adapter_name);
if (adapter_handle != 0)
{
printf("Successfully opened %s\n",
adapter_name);
HBA_CloseAdapter(adapter_handle);
}
}
}
}
Informational Functions
Call the following functions to acquire information about adapters and specified ports on the
adapters:
HBA_GetAdapterAttributes
Function:
HBA_STATUS HBA_GetAdapterAttributes(
HBA_HANDLE handle,
Informational Functions 15