fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * *****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Description
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * hbaapi.h - general header file for client
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and library developers
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the SNIA Public License
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Version 1.0 (the "License"); you may not use this file except in
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compliance with the License. You may obtain a copy of the License at
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /http://www.snia.org/English/Resources/Code/OpenSource.html
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Software distributed under the License is distributed on an "AS IS"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the License for the specific language governing rights and limitations
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The Original Code is SNIA HBA API general header file
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The Initial Developer of the Original Code is:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Benjamin F. Kuo, Troika Networks, Inc. (benk@troikanetworks.com)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Contributor(s):
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Tuan Lam, QLogic Corp. (t_lam@qlc.com)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Dan Willie, Emulex Corp. (Dan.Willie@emulex.com)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Dixon Hutchinson, Legato Systems, Inc. (dhutchin@legato.com)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * David Dillard, VERITAS Software Corp. (david.dillard@veritas.com)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *******************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 03/09/2000 Initial Draft
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (for other changes... see the CVS logs)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *******************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Library version string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* DLL imports for WIN32 operation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* OS specific definitions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef unsigned char HBA_UINT8; // Unsigned 8 bits
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef unsigned short HBA_UINT16; // Unsigned 16 bits
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef unsigned int HBA_UINT32; // Unsigned 32 bits
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Don't confuse, _WIN32 with WIN32... OK, how do you accompish that */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* #ifdef _WIN32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Note this section needs to be cleaned up for various Unix platforms */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef unsigned char HBA_UINT8; /* Unsigned 8 bits */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef unsigned short HBA_UINT16; /* Unsigned 16 bits */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef unsigned int HBA_UINT32; /* Unsigned 32 bits */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef HBA_UINT32 HBA_VOID32; /* Opaque 32 bits */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* #ifdef WIN32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.1 Handle to Device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.2 Status Return Values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_NOT_SUPPORTED 2 /* Function not supported.*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_INVALID_HANDLE 3 /* invalid handle */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_ILLEGAL_WWN 5 /* WWN not recognized */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_ILLEGAL_INDEX 6 /* Index not recognized */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_MORE_DATA 7 /* Larger buffer required */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_STALE_DATA 8 /* Information has changed since
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * last call to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * HBA_Refreshinformation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_SCSI_CHECK_CONDITION 9 /* Obvious */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_BUSY 10 /* Adapter busy or reserved,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * retry may be effective */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_TRY_AGAIN 11 /* Request timedout,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * retry may be effective */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_UNAVAILABLE 12 /* Referenced HBA has been removed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or deactivated */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_ELS_REJECT 13 /* The requested ELS was rejected by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the local adapter */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_INVALID_LUN 14 /* The specified LUN is not provided
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the specified adapter */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_INCOMPATIBLE 15 /* An incompatibility has been
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * detected among the library and driver modules
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * invoked which will cause one or more functions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in the highest version that all support to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operate incorrectly. The differing function
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sets of software modules implementing different
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * versions of the HBA API specification does not
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in itself constitute an incompatibility. Known
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * interoperability bugs among supposedly
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compatible versions should be reported as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * incompatibilities, but not all such
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * interoperability bugs may be known. This value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * may be returned by any function that calls a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Vendor Specific Library and returns an
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * HBA_STATUS, and by HBA_LoadLibrary and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * HBA_GetAdapterName. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_AMBIGUOUS_WWN 16 /* Multiple adapters have a matching
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * WWN. This could occur if the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NodeWWN of multiple adapters is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * identical */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_LOCAL_BUS 17 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a bad local SCSI bus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_LOCAL_TARGET 18 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a bad local SCSI target
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_LOCAL_LUN 19 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a bad local SCSI logical
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * unit number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* A persistent binding set request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a local SCSI ID that was
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * already bound */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_TARGET_FCID 21 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a bad or unlocatable FCP
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Target FCID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_TARGET_NODE_WWN 22 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a bad FCP Target Node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_TARGET_PORT_WWN 23 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a bad FCP Target Port
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_TARGET_LUN 24 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included an FCP Logical Unit Number
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * not defined by the identified
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_TARGET_LUID 25 /* A persistent binding request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included an undefined or otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * inaccessible Logical Unit Unique
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Identifier */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_NO_SUCH_BINDING 26 /* A persistent binding remove request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * included a binding which did not
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * match a binding established by the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * specified port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_NOT_A_TARGET 27 /* A SCSI command was requested to an
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Nx_Port that was not a SCSI
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Target Port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_UNSUPPORTED_FC4 28 /* A request was made concerning an
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * unsupported FC-4 protocol */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_STATUS_ERROR_INCAPABLE 29 /* A request was made to enable
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * unimplemented capabilities for a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.3 Port Operational Modes Values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTTYPE_NOTPRESENT 3 /* Not present */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTTYPE_EPORT 9 /* Fabric expansion port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTTYPE_GPORT 10 /* Generic Fabric Port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTSTATE_OFFLINE 3 /* User Offline */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTSTATE_DIAGNOSTICS 5 /* In diagnostics mode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTSPEED_UNKNOWN 0 /* Unknown - transceiver incable
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of reporting */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBA_PORTSPEED_NOT_NEGOTIATED (1<<15) /* Speed not established */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.4 Class of Service Values - See GS-2 Spec.*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.5 Fc4Types Values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_UINT8 bits[32]; /* 32 bytes of FC-4 per GS-2 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.6 Basic Types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.7 Adapter Attributes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char ModelDescription[256]; /* Agilent TachLite */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char OptionROMVersion[256]; /* Vendor use - i.e. hardware boot ROM*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_UINT32 VendorSpecificID; /* Vendor specific */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char DriverName[256]; /* Binary path and/or name of driver
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.8 Port Attributes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.9 Port Statistics */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.10 FCP Attributes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum HBA_fcpbindingtype { TO_D_ID, TO_WWN, TO_OTHER } HBA_FCPBINDINGTYPE;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_UINT32 ScsiTargetNumber; /* SCSI Target ID to OS */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_FCPSCSIENTRY entry[1]; /* Variable length array
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * containing mappings */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_FCPSCSIENTRYV2 entry[1]; /* Variable length array
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * containing mappings */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} HBA_FCPTARGETMAPPINGV2, *PHBA_FCPTARGETMAPPINGV2;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to WWN, FcpLun always valid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_FCPBINDINGENTRY entry[1]; /* Variable length array */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 4.2.11 FC-3 Management Atrributes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum HBA_wwntype { NODE_WWN, PORT_WWN } HBA_WWNTYPE;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Event Codes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_UINT32 PortFcId; /* Port where event occurred */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_UINT32 PortFcId; /* Port where event occurred */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_UINT32 NPortPage; /* Reference FC-FS for RSCN ELS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * "Affected N-Port Pages"*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Persistant Binding... */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* A bit mask of Rev 2.0 persistent binding capabilities */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* The following are bit flags indicating persistent binding capabilities */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* FC-4 Instrumentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Adapter Level Events */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Port Level Events */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Port Statistics Events */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Target Level Events */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Fabric Link Events */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Make sure HBA_LoadLibrary returns before any other threads
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * make calls to the library
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_STATUS HBA_GetDiscoveredPortAttributes(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Depricated, but supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Depricated, but supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Depricated, but supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_STATUS HBA_RemoveAllPersistentBindings(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Depricated, but supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Depricated, but supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Depricated, but supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_UINT32 HBA_GetVendorLibraryAttributes (
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_STATUS HBA_RegisterForAdapterAddEvents(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_STATUS HBA_RegisterForAdapterPortEvents(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_STATUS HBA_RegisterForAdapterPortStatEvents(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Wrapper library specific entry points */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_API HBA_UINT32 HBA_GetWrapperLibraryAttributes (
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* HBA_API_H */