Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

HBA_OpenAdapter(3) OSS Library Calls Reference Manual
NAME
HBA_OpenAdapter - Opens the specified Host Bus Adapter
LIBRARY
H-series OSS processes: /usr/lib/libcmnapi.a
SYNOPSIS
#include <snia_common.h>
HBA_HANDLE HBA_OpenAdapter (
char adapter_name,
);
PARAMETERS
adapter_name The name of an adapter returned by a call to the HBA_GetAdapterName( )
function.
DESCRIPTION
This function opens an adapter that has a name. By opening the adapter, an application is ensur-
ing that all access to the handle of type HBA_HANDLE (refer to the Fibre Channel - Methodolo-
gies for Interconnects (FC-MI) Revision 1.6) between an open and a close is to the same adapter.
A call to HBA_OpenAdapter( ) does not necessarily imply a driver "open" and this behavior
depends on the implementation of the vendor. The parameter adapter_name is a textual descrip-
tion of an adapter as retrieved from a call to the HBA_GetAdapterName( ) function.
Calling Order
You must call the HBA_GetAdapterName( ) function for an adapter at least once before you
can call the HBA_OpenAdapter( ) function for the same adapter.
You must call the HBA_OpenAdapter( ) function for an adapter before you can call the
HBA_GetAdapterPortAttributes( ) function or the HBA_GetPortStatistics( ) function for the
same adapter.
EXAMPLES
int i;
HBA_STATUS status;
HBA_HANDLE adapterhandle;
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) {
adapterhandle = HBA_OpenAdapter(adapter_name);
if (adapterhandle != 0) {
printf("Successfully opened %s",
adapter_name);
HBA_CloseAdapter(adapterhandle);
}
}
}
RETURN VALUES
Upon successful completion, the HBA_OpenAdapter( ) function returns the handle to the
opened adapter instance. Otherwise a value of 0 (zero) is returned.
3188 Hewlett-Packard Company 527187-017