xref: /illumos-gate/usr/src/man/man3lib/libSMHBAAPI.3lib (revision a3c49ce110f325a563c245bedc4d533adddb7211)
te
Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
libSMHBAAPI 3LIB "28 Sep 2009" "SunOS 5.11" "Interface Libraries"
NAME
libSMHBAAPI, libsmhbaapi, SMHBA_GetAdapterAttributes, SMHBA_GetAdapterPortAttributes, SMHBA_GetBindingCapability, SMHBA_GetBindingSupport, SMHBA_GetDiscoveredPortAttributes, SMHBA_GetFCPhyAttributes, SMHBA_GetLUNStatistics, SMHBA_GetNumberofPorts, SMHBA_GetPersistentBinding, SMHBA_GetPhyStatistics, SMHBA_GetPortAttributesByWWN, SMHBA_GetPortType, SMHBA_GetProtocolStatistics, SMHBA_GetSASPhyAttributes, SMHBA_GetTargetMapping, SMHBA_GetVendorLibraryAttributes, SMHBA_GetVersion, SMHBA_GetWrapperLibraryAttributes, SMHBA_RegisterForAdapterAddEvents, SMHBA_RegisterForAdapterEvents, SMHBA_RegisterForAdapterPhyStatEvents, SMHBA_RegisterForAdapterPortEvents, SMHBA_RegisterForAdapterPortStatEvents, SMHBA_RegisterForTargetEvents, SMHBA_RegisterLibrary, SMHBA_RemoveAllPersistentBindings, SMHBA_RemovePersistentBinding, SMHBA_ScsiInquiry, SMHBA_ScsiReadCapacity, SMHBA_ScsiReportLuns, SMHBA_SendECHO, SMHBA_SendSMPPassThru, SMHBA_SendTEST, SMHBA_SetBindingSupport, SMHBA_SetPersistentBinding - Common Storage Management HBA information library
SYNOPSIS

cc [ flag.\|.\|. ] file.\|.\|. -lSMHBAAPI [ library.\|.\|. ]
#include <smhbaapi.h>
DESCRIPTION

The functions in this library access Fibre Channel and/or Sereal Attached SCSI HBA data depending on vendor provided implementation underneath.

HBA information is provided through a standard interface in a vendor independent manner. This common interface provides access to the following information:

Local HBA attributes

Local HBA port attributes and statistics

Mapping between discovered devices and operating system SCSI information

Discovered devices port attributes

SCSI commands for discovered devices (Report LUNS, Read Capacity, and Inquiry)

Storage Managment Protocol commands to discover Serial Attached SCSI configuration details

Common Transport commands to discover Fibre Channel Fabric details

INTERFACES

The shared object libSMHBAAPI.so.1 provides the public interfaces defined below. See Intro(3) for additional information on shared object interfaces.

HBA_CloseAdapterHBA_FreeLibrary
HBA_GetAdapterNameHBA_GetNumberOfAdapters
HBA_GetRNIDMgmtInfoHBA_LoadLibrary
HBA_OpenAdapterHBA_RefreshAdapterConfiguration
HBA_RefreshInformationHBA_RegisterForLinkEvents
HBA_RemoveCallbackHBA_SendCTPassThruV2
HBA_SendLIRRHBA_SendRLS
HBA_SendRNIDV2HBA_SendRPL
HBA_SendRPSHBA_SendSRL
HBA_SetRNIDMgmtInfoSMHBA_GetAdapterAttributes
SMHBA_GetAdapterPortAttributesSMHBA_GetBindingCapability
SMHBA_GetBindingSupportSMHBA_GetDiscoveredPortAttributes
SMHBA_GetFCPhyAttributesSMHBA_GetLUNStatistics
SMHBA_GetNumberofPortsSMHBA_GetPersistentBinding
SMHBA_GetPhyStatisticsSMHBA_GetPortAttributesByWWN
SMHBA_GetPortTypeSMHBA_GetProtocolStatistics
SMHBA_GetSASPhyAttributesSMHBA_GetTargetMapping
SMHBA_GetVendorLibraryAttributesSMHBA_GetVersion
SMHBA_GetWrapperLibraryAttributesSMHBA_RegisterForAdapterAddEvents
SMHBA_RegisterForAdapterEventsSMHBA_RegisterForAdapterPhyStatEvents
SMHBA_RegisterForAdapterPortEventsSMHBA_RegisterForAdapterPortStatEvents
SMHBA_RegisterForTargetEventsSMHBA_RegisterLibrary
SMHBA_RemoveAllPersistentBindingsSMHBA_RemovePersistentBinding
SMHBA_ScsiInquirySMHBA_ScsiReadCapacity
SMHBA_ScsiReportLunsSMHBA_SendECHO
SMHBA_SendSMPPassThruSMHBA_SendTEST
SMHBA_SetBindingSupportSMHBA_SetPersistentBinding
USAGE

Client applications link with the Common Library (using -lSMHBAAPI) to access the interfaces. The Common Library dynamically loads individual Vendor-Specific Libraries (VSL) listed in /etc/smhba.conf and described on smhba.conf(4).

Using the libSMHBAAPI involves the following steps:

1. Optionally determining the version of the library by calling SMHBA_GetVersion().

2. Initializing the Common Library by calling HBA_LoadLibrary().

3. Determine the number of HBAs known to the common library by calling HBA_GetNumberOfAdapters().

4. Determine each HBA name in turn by calling HBA_GetAdapterName().

5. Open each HBA in turn by calling HBA_OpenAdapter().

6. Operate on a given HBA by calling the following:

SMHBA_GetAdapterAttributes()

SMHBA_GetAdapterPortAttributes()

SMHBA_GetDiscoveredPortAttributes()

SMHBA_GetPortAttributesByWWN()

SMHBA_GetNumberofPorts()

SMHBA_GetPortType()

SMHBA_GetProtocolStatistics()

SMHBA_GetPhyStatistics()

SMHBA_GetBindingCapability()

SMHBA_GetBindingSupport()

SMHBA_SetBindingSupport()

SMHBA_GetTargetMapping()

SMHBA_GetPersistentBinding()

SMHBA_SetPersistentBinding()

SMHBA_RemoveAllPersistentBindings()

SMHBA_GetLUNStatistics()

SMHBA_SendScsiInquiry()

SMHBA_SendReportLuns()

SMHBA_SendReadCapacity()

SMHBA_RegisterForAdapterAddEvents()

SMHBA_RegisterForAdapterEvents()

SMHBA_RegisterForAdapterPortEvents()

SMHBA_RegisterForAdapterPortStatEvents()

SMHBA_RegisterForAdapterPhyStatEvents()

SMHBA_RegisterForTargetEvents()

HBA_RegisterForLinkEvents()

HBA_RemoveCallback()

For Serial Attached HBA

SMHBA_GetSASPhyAttributes()

SMHBA_SendSMPPassThru()

For Fibre Channle HBA

SMHBA_GetFCPhyAttributes()

HBA_SendCTPassThruV2()

HBA_SetRNIDMgmtInfo()

HBA_GetRNIDMgmtInfo()

HBA_SendRNIDV2()

HBA_SendRPL()

HBA_SendRPS()

HBA_SendSRL()

HBA_SendLIRR()

HBA_SendRLS()

HBA_SendTEST()

HBA_SendECHO()

7. Close open HBAs by calling HBA_CloseAdapter().

8. Unload the library by calling HBA_FreeLibrary().

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
Interface StabilityCommitted
MT-LevelMT-Safe
Standard
ANSI INCITS 428 Storage Management Host Bus Adapter Application Programming Interface (SM-HBA)
SEE ALSO

smhba.conf(4), attributes(5)