Gets the name of a Common Host Bus Adapter.
Common Host Bus Adapter Library (libHBAAPI.a)
#include <sys/hbaapi.h>
HBA_STATUS HBA_GetAdapterName (adapterindex, adaptername)
HBA_UINT32 adapterindex;
char *adaptername;
The HBA_GetAdapterName subroutine gets the name of a Common Host Bus Adapter. The adapterindex parameter is an index into an internal table containing all FCP adapters on the machine. The adapterindex parameter is used to search the table and obtain the adapter name. The name of the adapter is returned in the form of mgfdomain-model-adapterindex. The name of the adapter is used as an argument for the HBA_OpenAdapter subroutine. From the HBA_OpenAdapter subroutine, the file descriptor will be obtained where additional Common HBA API routines can then be called using the file descriptor as the argument.
Item | Description |
---|---|
adapterindex | Specifies the index of the adapter held in the adapter table for which the name of the adapter is to be returned. |
adaptername | Points to a character string that will be used to hold the name of the adapter. |
Upon successful completion, the HBA_GetAdapterName subroutine returns the name of the adapter and a 0, or a status code of HBA_STATUS_OK. If unsuccessful, a null value will be returned for adaptername and an value of 1, or a status code of HBA_STATUS_ERROR.
Item | Description |
---|---|
HBA_STATUS_OK | A value of 0 on successful completion. |
HBA_STATUS_ERROR | A value of 1 if an error occurred. |
HBA_STATUS_ERROR_NOT_SUPPORTED | A value of 2 if the function is not supported. |
HBA_STATUS_ERROR_INVALID_HANDLE | A value of 3 if there was an invalid file handle. |
HBA_STATUS_ERROR_ARG | A value of 4 if there was a bad argument. |
HBA_STATUS_ERROR_ILLEGAL_WWN | A value of 5 if the world wide name was not recognized. |
HBA_STATUS_ERROR_ILLEGAL_INDEX | A value of 6 if an index was not recognized. |
HBA_STATUS_ERROR_MORE_DATA | A value of 7 if a larger buffer is required. |
HBA_STATUS_ERROR_STALE_DATA | A value of 8 if information has changed since the last call to the HBA_RefreshInformation subroutine. |
HBA_STATUS_SCSI_CHECK_CONDITION | A value of 9 if a SCSI Check Condition was reported. |
HBA_STATUS_ERROR_BUSY | A value of 10 if the adapter was busy or reserved. Try again later. |
HBA_STATUS_ERROR_TRY_AGAIN | A value of 11 if the request timed out. Try again later. |
HBA_STATUS_ERROR_UNAVAILABLE | A value of 12 if the referenced HBA has been removed or deactivated. |