1fcf3ce4John Forte/*
2fcf3ce4John Forte * *****************************************************************************
3fcf3ce4John Forte *
4fcf3ce4John Forte * Description
5fcf3ce4John Forte *	hbaapi.h - general header file for client
6fcf3ce4John Forte * 		 and library developers
7fcf3ce4John Forte *
8fcf3ce4John Forte * License:
9fcf3ce4John Forte *	The contents of this file are subject to the SNIA Public License
10fcf3ce4John Forte *	Version 1.0 (the "License"); you may not use this file except in
11fcf3ce4John Forte *	compliance with the License. You may obtain a copy of the License at
12fcf3ce4John Forte *
13fcf3ce4John Forte *	/http://www.snia.org/English/Resources/Code/OpenSource.html
14fcf3ce4John Forte *
15fcf3ce4John Forte *	Software distributed under the License is distributed on an "AS IS"
16fcf3ce4John Forte *	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17fcf3ce4John Forte *	the License for the specific language governing rights and limitations
18fcf3ce4John Forte *	under the License.
19fcf3ce4John Forte *
20fcf3ce4John Forte * The Original Code is  SNIA HBA API general header file
21fcf3ce4John Forte *
22fcf3ce4John Forte * The Initial Developer of the Original Code is:
23fcf3ce4John Forte *	Benjamin F. Kuo, Troika Networks, Inc. (benk@troikanetworks.com)
24fcf3ce4John Forte *
25fcf3ce4John Forte * Contributor(s):
26fcf3ce4John Forte *	Tuan Lam, QLogic Corp. (t_lam@qlc.com)
27fcf3ce4John Forte *	Dan Willie, Emulex Corp. (Dan.Willie@emulex.com)
28fcf3ce4John Forte *	Dixon Hutchinson, Legato Systems, Inc. (dhutchin@legato.com)
29fcf3ce4John Forte *	David Dillard, VERITAS Software Corp. (david.dillard@veritas.com)
30fcf3ce4John Forte *
31fcf3ce4John Forte *******************************************************************************
32fcf3ce4John Forte *
33fcf3ce4John Forte *   Changes:
34fcf3ce4John Forte *	03/09/2000 Initial Draft
35fcf3ce4John Forte *	(for other changes... see the CVS logs)
36fcf3ce4John Forte *******************************************************************************
37fcf3ce4John Forte */
38fcf3ce4John Forte
39a317005Paul Winder/*
40a317005Paul Winder * Copyright 2020 RackTop Systems, Inc.
41a317005Paul Winder */
42a317005Paul Winder
43fcf3ce4John Forte#ifdef __cplusplus
44fcf3ce4John Forteextern "C" {
45fcf3ce4John Forte#endif
46fcf3ce4John Forte
47fcf3ce4John Forte
48fcf3ce4John Forte#ifndef HBA_API_H
49fcf3ce4John Forte#define HBA_API_H
50fcf3ce4John Forte
51fcf3ce4John Forte/* Library version string */
52fcf3ce4John Forte#define HBA_LIBVERSION 2
53fcf3ce4John Forte
54fcf3ce4John Forte/* DLL imports for WIN32 operation */
55fcf3ce4John Forte#ifdef WIN32
56fcf3ce4John Forte#ifdef HBAAPI_EXPORTS
57fcf3ce4John Forte#define HBA_API __declspec(dllexport)
58fcf3ce4John Forte#else
59fcf3ce4John Forte#define HBA_API __declspec(dllimport)
60fcf3ce4John Forte#endif
61fcf3ce4John Forte#else
62fcf3ce4John Forte#define HBA_API
63fcf3ce4John Forte#endif
64fcf3ce4John Forte
65fcf3ce4John Forte/* OS specific definitions */
66fcf3ce4John Forte
67fcf3ce4John Forte#ifdef WIN32
68fcf3ce4John Fortetypedef unsigned char	HBA_UINT8;	// Unsigned  8 bits
69fcf3ce4John Fortetypedef		 char	HBA_INT8;	// Signed    8 bits
70fcf3ce4John Fortetypedef unsigned short	HBA_UINT16;	// Unsigned 16 bits
71fcf3ce4John Fortetypedef		 short	HBA_INT16;	// Signed   16 bits
72fcf3ce4John Fortetypedef unsigned int	HBA_UINT32;	// Unsigned 32 bits
73fcf3ce4John Fortetypedef		 int	HBA_INT32;	// Signed   32 bits
74fcf3ce4John Fortetypedef void*		HBA_PVOID;	// Pointer  to void
75fcf3ce4John Fortetypedef HBA_UINT32	HBA_VOID32;	// Opaque   32 bits
76fcf3ce4John Forte
77fcf3ce4John Forte
78fcf3ce4John Forte/* Don't confuse, _WIN32 with WIN32... OK, how do you accompish that */
79fcf3ce4John Forte#ifdef _WIN32
80fcf3ce4John Fortetypedef			_int64		HBA_INT64;
81fcf3ce4John Fortetypedef			unsigned _int64	HBA_UINT64;
82fcf3ce4John Forte#else
83fcf3ce4John Fortetypedef struct {
84fcf3ce4John Forte	TN_UINT32	lo_val;
85fcf3ce4John Forte	TN_UINT32	hi_val;
86fcf3ce4John Forte} HBA_INT64;
87fcf3ce4John Forte
88fcf3ce4John Fortetypedef struct {
89fcf3ce4John Forte	TN_UINT32	lo_val;
90fcf3ce4John Forte	TN_UINT32	hi_val;
91fcf3ce4John Forte} HBA_UINT64;
92fcf3ce4John Forte#endif	/*	#ifdef _WIN32	*/
93fcf3ce4John Forte
94fcf3ce4John Forte
95fcf3ce4John Forte#else
96fcf3ce4John Forte#include <time.h> /* Needed for struct tm */
97fcf3ce4John Forte
98fcf3ce4John Forte/* Note this section needs to be cleaned up for various Unix platforms */
99fcf3ce4John Fortetypedef unsigned char	HBA_UINT8;	/* Unsigned  8 bits */
100fcf3ce4John Fortetypedef		 char	HBA_INT8;	/* Signed    8 bits */
101fcf3ce4John Fortetypedef unsigned short	HBA_UINT16;	/* Unsigned 16 bits */
102fcf3ce4John Fortetypedef		 short	HBA_INT16;	/* Signed   16 bits */
103fcf3ce4John Fortetypedef unsigned int	HBA_UINT32;	/* Unsigned 32 bits */
104fcf3ce4John Fortetypedef		 int	HBA_INT32;	/* Signed   32 bits */
105fcf3ce4John Fortetypedef void*		HBA_PVOID;	/* Pointer  to void */
106fcf3ce4John Fortetypedef HBA_UINT32	HBA_VOID32;	/* Opaque   32 bits */
107fcf3ce4John Fortetypedef long long	HBA_INT64;
108fcf3ce4John Fortetypedef long long	HBA_UINT64;
109fcf3ce4John Forte
110fcf3ce4John Forte#endif  /*  #ifdef WIN32 */
111fcf3ce4John Forte
112fcf3ce4John Forte
113fcf3ce4John Forte/* 4.2.1	Handle to Device */
114fcf3ce4John Fortetypedef HBA_UINT32	HBA_HANDLE;
115fcf3ce4John Forte
116fcf3ce4John Forte#define HBA_HANDLE_INVALID		0
117fcf3ce4John Forte
118fcf3ce4John Forte/* 4.2.2	Status Return Values */
119fcf3ce4John Fortetypedef HBA_UINT32	HBA_STATUS;
120fcf3ce4John Forte
121fcf3ce4John Forte#define HBA_STATUS_OK			0
122fcf3ce4John Forte#define HBA_STATUS_ERROR		1   /* Error */
123fcf3ce4John Forte#define HBA_STATUS_ERROR_NOT_SUPPORTED	2   /* Function not supported.*/
124fcf3ce4John Forte#define HBA_STATUS_ERROR_INVALID_HANDLE	3   /* invalid handle */
125fcf3ce4John Forte#define HBA_STATUS_ERROR_ARG		4   /* Bad argument */
126fcf3ce4John Forte#define HBA_STATUS_ERROR_ILLEGAL_WWN	5   /* WWN not recognized */
127fcf3ce4John Forte#define HBA_STATUS_ERROR_ILLEGAL_INDEX	6   /* Index not recognized */
128fcf3ce4John Forte#define HBA_STATUS_ERROR_MORE_DATA	7   /* Larger buffer required */
129fcf3ce4John Forte#define HBA_STATUS_ERROR_STALE_DATA	8   /* Information has changed since
130fcf3ce4John Forte					     * last call to
131fcf3ce4John Forte					     * HBA_Refreshinformation */
132fcf3ce4John Forte#define HBA_STATUS_SCSI_CHECK_CONDITION	9   /* Obvious */
133fcf3ce4John Forte#define HBA_STATUS_ERROR_BUSY		10  /* Adapter busy or reserved,
134fcf3ce4John Forte					     * retry may be effective */
135fcf3ce4John Forte#define HBA_STATUS_ERROR_TRY_AGAIN	11  /* Request timedout,
136fcf3ce4John Forte					     * retry may be effective */
137fcf3ce4John Forte#define HBA_STATUS_ERROR_UNAVAILABLE	12  /* Referenced HBA has been removed
138fcf3ce4John Forte					     * or deactivated */
139fcf3ce4John Forte#define HBA_STATUS_ERROR_ELS_REJECT	13  /* The requested ELS was rejected by
140fcf3ce4John Forte					     * the local adapter */
141fcf3ce4John Forte#define HBA_STATUS_ERROR_INVALID_LUN	14  /* The specified LUN is not provided
142fcf3ce4John Forte					     *  the specified adapter */
143fcf3ce4John Forte#define HBA_STATUS_ERROR_INCOMPATIBLE	15  /* An incompatibility has been
144fcf3ce4John Forte				* detected among the library and driver modules
145fcf3ce4John Forte				* invoked which will cause one or more functions
146fcf3ce4John Forte				* in the highest version that all support to
147fcf3ce4John Forte				* operate incorrectly.  The differing function
148fcf3ce4John Forte				* sets of software modules implementing different
149fcf3ce4John Forte				* versions of the HBA API specification does not
150fcf3ce4John Forte				* in itself constitute an incompatibility.  Known
151fcf3ce4John Forte				* interoperability bugs among supposedly
152fcf3ce4John Forte				* compatible versions should be reported as
153fcf3ce4John Forte				* incompatibilities, but not all such
154fcf3ce4John Forte				* interoperability bugs may be known.  This value
155fcf3ce4John Forte				* may be returned by any function that calls a
156fcf3ce4John Forte				* Vendor Specific Library and returns an
157fcf3ce4John Forte				* HBA_STATUS, and by HBA_LoadLibrary and
158fcf3ce4John Forte				* HBA_GetAdapterName. */
159fcf3ce4John Forte
160fcf3ce4John Forte#define HBA_STATUS_ERROR_AMBIGUOUS_WWN	16  /* Multiple adapters have a matching
161fcf3ce4John Forte					     * WWN. This could occur if the
162fcf3ce4John Forte					     * NodeWWN of multiple adapters is
163fcf3ce4John Forte					     * identical */
164fcf3ce4John Forte#define HBA_STATUS_ERROR_LOCAL_BUS	17  /* A persistent binding request
165fcf3ce4John Forte					     * included a bad local SCSI bus
166fcf3ce4John Forte					     * number */
167fcf3ce4John Forte#define HBA_STATUS_ERROR_LOCAL_TARGET	18  /* A persistent binding request
168fcf3ce4John Forte					     * included a bad local SCSI target
169fcf3ce4John Forte					     * number */
170fcf3ce4John Forte#define HBA_STATUS_ERROR_LOCAL_LUN	19  /* A persistent binding request
171fcf3ce4John Forte					     * included a bad local SCSI logical
172fcf3ce4John Forte					     * unit number */
173fcf3ce4John Forte#define HBA_STATUS_ERROR_LOCAL_SCSIID_BOUND 20
174fcf3ce4John Forte					    /* A persistent binding set request
175fcf3ce4John Forte					     * included a local SCSI ID that was
176fcf3ce4John Forte					     * already bound */
177fcf3ce4John Forte#define HBA_STATUS_ERROR_TARGET_FCID	21  /* A persistent binding request
178fcf3ce4John Forte					     * included a bad or unlocatable FCP
179fcf3ce4John Forte					     * Target FCID */
180fcf3ce4John Forte#define HBA_STATUS_ERROR_TARGET_NODE_WWN 22 /* A persistent binding request
181fcf3ce4John Forte					     * included a bad FCP Target Node
182fcf3ce4John Forte					     * WWN */
183fcf3ce4John Forte#define HBA_STATUS_ERROR_TARGET_PORT_WWN 23 /* A persistent binding request
184fcf3ce4John Forte					     * included a bad FCP Target Port
185fcf3ce4John Forte					     * WWN */
186fcf3ce4John Forte#define HBA_STATUS_ERROR_TARGET_LUN	24  /* A persistent binding request
187fcf3ce4John Forte					     * included an FCP Logical Unit Number
188fcf3ce4John Forte					     * not defined by the identified
189fcf3ce4John Forte					     * Target*/
190fcf3ce4John Forte#define HBA_STATUS_ERROR_TARGET_LUID	25  /* A persistent binding request
191fcf3ce4John Forte					     * included an undefined or otherwise
192fcf3ce4John Forte					     * inaccessible Logical Unit Unique
193fcf3ce4John Forte					     * Identifier */
194fcf3ce4John Forte#define HBA_STATUS_ERROR_NO_SUCH_BINDING 26 /* A persistent binding remove request
195fcf3ce4John Forte					     * included a binding which did not
196fcf3ce4John Forte					     * match a binding established by the
197fcf3ce4John Forte					     * specified port */
198fcf3ce4John Forte#define HBA_STATUS_ERROR_NOT_A_TARGET	27  /* A SCSI command was requested to an
199fcf3ce4John Forte					     * Nx_Port that was not a SCSI
200fcf3ce4John Forte					     * Target Port */
201fcf3ce4John Forte#define HBA_STATUS_ERROR_UNSUPPORTED_FC4 28 /* A request was made concerning an
202fcf3ce4John Forte					     * unsupported FC-4 protocol */
203fcf3ce4John Forte
204fcf3ce4John Forte
205fcf3ce4John Forte#define HBA_STATUS_ERROR_INCAPABLE	29  /* A request was made to enable
206fcf3ce4John Forte					     * unimplemented capabilities for a
207fcf3ce4John Forte					     * port */
208fcf3ce4John Forte
209fcf3ce4John Forte/* 4.2.3	Port Operational Modes Values */
210fcf3ce4John Fortetypedef HBA_UINT32 HBA_PORTTYPE;
211fcf3ce4John Forte
212fcf3ce4John Forte#define HBA_PORTTYPE_UNKNOWN		1   /* Unknown */
213fcf3ce4John Forte#define HBA_PORTTYPE_OTHER		2   /* Other */
214fcf3ce4John Forte#define HBA_PORTTYPE_NOTPRESENT		3   /* Not present */
215fcf3ce4John Forte#define HBA_PORTTYPE_NPORT		5   /* Fabric  */
216fcf3ce4John Forte#define HBA_PORTTYPE_NLPORT		6   /* Public Loop */
217fcf3ce4John Forte#define HBA_PORTTYPE_FLPORT		7
218fcf3ce4John Forte#define HBA_PORTTYPE_FPORT		8   /* Fabric Port */
219fcf3ce4John Forte#define HBA_PORTTYPE_EPORT		9   /* Fabric expansion port */
220fcf3ce4John Forte#define HBA_PORTTYPE_GPORT		10  /* Generic Fabric Port */
221fcf3ce4John Forte#define HBA_PORTTYPE_LPORT		20  /* Private Loop */
222fcf3ce4John Forte#define HBA_PORTTYPE_PTP		21  /* Point to Point */
223fcf3ce4John Forte
224fcf3ce4John Forte
225fcf3ce4John Fortetypedef HBA_UINT32 HBA_PORTSTATE;
226fcf3ce4John Forte#define HBA_PORTSTATE_UNKNOWN		1   /* Unknown */
227fcf3ce4John Forte#define HBA_PORTSTATE_ONLINE		2   /* Operational */
228fcf3ce4John Forte#define HBA_PORTSTATE_OFFLINE		3   /* User Offline */
229fcf3ce4John Forte#define HBA_PORTSTATE_BYPASSED		4   /* Bypassed */
230fcf3ce4John Forte#define HBA_PORTSTATE_DIAGNOSTICS	5   /* In diagnostics mode */
231fcf3ce4John Forte#define HBA_PORTSTATE_LINKDOWN		6   /* Link Down */
232fcf3ce4John Forte#define HBA_PORTSTATE_ERROR		7   /* Port Error */
233fcf3ce4John Forte#define HBA_PORTSTATE_LOOPBACK		8   /* Loopback */
234fcf3ce4John Forte
235fcf3ce4John Forte
236fcf3ce4John Fortetypedef HBA_UINT32 HBA_PORTSPEED;
237fcf3ce4John Forte#define HBA_PORTSPEED_UNKNOWN		0   /* Unknown - transceiver incable
238fcf3ce4John Forte					     * of reporting */
239fcf3ce4John Forte#define HBA_PORTSPEED_1GBIT		1   /* 1 GBit/sec */
240fcf3ce4John Forte#define HBA_PORTSPEED_2GBIT		2   /* 2 GBit/sec */
241fcf3ce4John Forte#define HBA_PORTSPEED_10GBIT		4   /* 10 GBit/sec */
242fcf3ce4John Forte#define HBA_PORTSPEED_4GBIT		8   /* 4 GBit/sec */
243fcf3ce4John Forte#define HBA_PORTSPEED_8GBIT		16  /* 8 GBit/sec */
244fcf3ce4John Forte#define HBA_PORTSPEED_16GBIT		32  /* 16 GBit/sec */
245a317005Paul Winder#define HBA_PORTSPEED_32GBIT		64  /* 32 GBit/sec */
246fcf3ce4John Forte#define HBA_PORTSPEED_NOT_NEGOTIATED	(1<<15)   /* Speed not established */
247fcf3ce4John Forte
248fcf3ce4John Forte
249fcf3ce4John Forte
250fcf3ce4John Forte/* 4.2.4	Class of Service Values - See GS-2 Spec.*/
251fcf3ce4John Forte
252fcf3ce4John Fortetypedef HBA_UINT32 HBA_COS;
253fcf3ce4John Forte
254fcf3ce4John Forte
255fcf3ce4John Forte/* 4.2.5	Fc4Types Values */
256fcf3ce4John Forte
257fcf3ce4John Fortetypedef struct HBA_fc4types {
258fcf3ce4John Forte    HBA_UINT8 bits[32];		/* 32 bytes of FC-4 per GS-2 */
259fcf3ce4John Forte} HBA_FC4TYPES, *PHBA_FC4TYPES;
260fcf3ce4John Forte
261fcf3ce4John Forte/* 4.2.6	Basic Types */
262fcf3ce4John Forte
263fcf3ce4John Fortetypedef struct HBA_wwn {
264fcf3ce4John Forte    HBA_UINT8 wwn[8];
265fcf3ce4John Forte} HBA_WWN, *PHBA_WWN;
266fcf3ce4John Forte
267fcf3ce4John Fortetypedef struct HBA_ipaddress {
268fcf3ce4John Forte    int	ipversion;		/* see enumerations in RNID */
269fcf3ce4John Forte    union
270fcf3ce4John Forte    {
271fcf3ce4John Forte	unsigned char ipv4address[4];
272fcf3ce4John Forte	unsigned char ipv6address[16];
273fcf3ce4John Forte    } ipaddress;
274fcf3ce4John Forte} HBA_IPADDRESS, *PHBA_IPADDRESS;
275fcf3ce4John Forte
276fcf3ce4John Fortetypedef HBA_INT8	HBA_BOOLEAN;
277fcf3ce4John Forte
278fcf3ce4John Forte/* 4.2.7	Adapter Attributes */
279fcf3ce4John Fortetypedef struct hba_AdapterAttributes {
280fcf3ce4John Forte    char	Manufacturer[64];	/*Emulex */
281fcf3ce4John Forte    char	SerialNumber[64];	/* A12345 */
282fcf3ce4John Forte    char	Model[256];		/* QLA2200 */
283fcf3ce4John Forte    char	ModelDescription[256];	/* Agilent TachLite */
284fcf3ce4John Forte    HBA_WWN	NodeWWN;
285fcf3ce4John Forte    char	NodeSymbolicName[256];	/* From GS-3 */
286fcf3ce4John Forte    char	HardwareVersion[256];	/* Vendor use */
287fcf3ce4John Forte    char	DriverVersion[256];	/* Vendor use */
288fcf3ce4John Forte    char	OptionROMVersion[256];	/* Vendor use  - i.e. hardware boot ROM*/
289fcf3ce4John Forte    char	FirmwareVersion[256];	/* Vendor use */
290fcf3ce4John Forte    HBA_UINT32	VendorSpecificID;	/* Vendor specific */
291fcf3ce4John Forte    HBA_UINT32	NumberOfPorts;
292fcf3ce4John Forte    char	DriverName[256];	/* Binary path and/or name of driver
293fcf3ce4John Forte					 *file */
294fcf3ce4John Forte} HBA_ADAPTERATTRIBUTES, *PHBA_ADAPTERATTRIBUTES;
295fcf3ce4John Forte
296fcf3ce4John Forte/* 4.2.8	Port Attributes */
297fcf3ce4John Fortetypedef struct HBA_PortAttributes {
298fcf3ce4John Forte    HBA_WWN		NodeWWN;
299fcf3ce4John Forte    HBA_WWN		PortWWN;
300fcf3ce4John Forte    HBA_UINT32		PortFcId;
301fcf3ce4John Forte    HBA_PORTTYPE	PortType;		/*PTP, Fabric, etc. */
302fcf3ce4John Forte    HBA_PORTSTATE	PortState;
303fcf3ce4John Forte    HBA_COS		PortSupportedClassofService;
304fcf3ce4John Forte    HBA_FC4TYPES	PortSupportedFc4Types;
305fcf3ce4John Forte    HBA_FC4TYPES	PortActiveFc4Types;
306fcf3ce4John Forte    char		PortSymbolicName[256];
307fcf3ce4John Forte    char		OSDeviceName[256];	/* \device\ScsiPort3  */
308fcf3ce4John Forte    HBA_PORTSPEED	PortSupportedSpeed;
309fcf3ce4John Forte    HBA_PORTSPEED	PortSpeed;
310fcf3ce4John Forte    HBA_UINT32		PortMaxFrameSize;
311fcf3ce4John Forte    HBA_WWN		FabricName;
312fcf3ce4John Forte    HBA_UINT32		NumberofDiscoveredPorts;
313fcf3ce4John Forte} HBA_PORTATTRIBUTES, *PHBA_PORTATTRIBUTES;
314fcf3ce4John Forte
315fcf3ce4John Forte
316fcf3ce4John Forte
317fcf3ce4John Forte/* 4.2.9	Port Statistics */
318fcf3ce4John Forte
319fcf3ce4John Fortetypedef struct HBA_PortStatistics {
320fcf3ce4John Forte    HBA_INT64		SecondsSinceLastReset;
321fcf3ce4John Forte    HBA_INT64		TxFrames;
322fcf3ce4John Forte    HBA_INT64		TxWords;
323fcf3ce4John Forte    HBA_INT64		RxFrames;
324fcf3ce4John Forte    HBA_INT64		RxWords;
325fcf3ce4John Forte    HBA_INT64		LIPCount;
326fcf3ce4John Forte    HBA_INT64		NOSCount;
327fcf3ce4John Forte    HBA_INT64		ErrorFrames;
328fcf3ce4John Forte    HBA_INT64		DumpedFrames;
329fcf3ce4John Forte    HBA_INT64		LinkFailureCount;
330fcf3ce4John Forte    HBA_INT64		LossOfSyncCount;
331fcf3ce4John Forte    HBA_INT64		LossOfSignalCount;
332fcf3ce4John Forte    HBA_INT64		PrimitiveSeqProtocolErrCount;
333fcf3ce4John Forte    HBA_INT64		InvalidTxWordCount;
334fcf3ce4John Forte    HBA_INT64		InvalidCRCCount;
335fcf3ce4John Forte} HBA_PORTSTATISTICS, *PHBA_PORTSTATISTICS;
336fcf3ce4John Forte
337fcf3ce4John Forte
338fcf3ce4John Forte
339fcf3ce4John Forte/* 4.2.10		FCP Attributes */
340fcf3ce4John Forte
341fcf3ce4John Fortetypedef enum HBA_fcpbindingtype { TO_D_ID, TO_WWN, TO_OTHER } HBA_FCPBINDINGTYPE;
342fcf3ce4John Forte
343fcf3ce4John Fortetypedef struct HBA_ScsiId {
344fcf3ce4John Forte    char		OSDeviceName[256];	/* \device\ScsiPort3  */
345fcf3ce4John Forte    HBA_UINT32		ScsiBusNumber;		/* Bus on the HBA */
346fcf3ce4John Forte    HBA_UINT32		ScsiTargetNumber;	/* SCSI Target ID to OS */
347fcf3ce4John Forte    HBA_UINT32		ScsiOSLun;
348fcf3ce4John Forte} HBA_SCSIID, *PHBA_SCSIID;
349fcf3ce4John Forte
350fcf3ce4John Fortetypedef struct HBA_FcpId {
351fcf3ce4John Forte    HBA_UINT32		FcId;
352fcf3ce4John Forte    HBA_WWN		NodeWWN;
353fcf3ce4John Forte    HBA_WWN		PortWWN;
354fcf3ce4John Forte    HBA_UINT64		FcpLun;
355fcf3ce4John Forte} HBA_FCPID, *PHBA_FCPID;
356fcf3ce4John Forte
357fcf3ce4John Fortetypedef struct HBA_LUID {
358fcf3ce4John Forte    char		buffer[256];	/* Unique Device Identifier */
359fcf3ce4John Forte} HBA_LUID, *PHBA_LUID;
360fcf3ce4John Forte
361fcf3ce4John Fortetypedef struct HBA_FcpScsiEntry {
362fcf3ce4John Forte    HBA_SCSIID		ScsiId;
363fcf3ce4John Forte    HBA_FCPID		FcpId;
364fcf3ce4John Forte} HBA_FCPSCSIENTRY, *PHBA_FCPSCSIENTRY;
365fcf3ce4John Forte
366fcf3ce4John Fortetypedef struct HBA_FcpScsiEntryV2 {
367fcf3ce4John Forte    HBA_SCSIID		ScsiId;
368fcf3ce4John Forte    HBA_FCPID		FcpId;
369fcf3ce4John Forte    HBA_LUID		LUID;
370fcf3ce4John Forte} HBA_FCPSCSIENTRYV2, *PHBA_FCPSCSIENTRYV2;
371fcf3ce4John Forte
372fcf3ce4John Fortetypedef struct HBA_FCPTargetMapping {
373fcf3ce4John Forte    HBA_UINT32		NumberOfEntries;
374fcf3ce4John Forte    HBA_FCPSCSIENTRY	entry[1];		/* Variable length array
375fcf3ce4John Forte						 * containing mappings */
376fcf3ce4John Forte} HBA_FCPTARGETMAPPING, *PHBA_FCPTARGETMAPPING;
377fcf3ce4John Forte
378fcf3ce4John Fortetypedef struct HBA_FCPTargetMappingV2 {
379fcf3ce4John Forte    HBA_UINT32		NumberOfEntries;
380fcf3ce4John Forte    HBA_FCPSCSIENTRYV2	entry[1];		/* Variable length array
381fcf3ce4John Forte						 * containing mappings */
382fcf3ce4John Forte} HBA_FCPTARGETMAPPINGV2, *PHBA_FCPTARGETMAPPINGV2;
383fcf3ce4John Forte
384fcf3ce4John Fortetypedef struct HBA_FCPBindingEntry {
385fcf3ce4John Forte    HBA_FCPBINDINGTYPE	type;
386fcf3ce4John Forte    HBA_SCSIID		ScsiId;
387fcf3ce4John Forte    HBA_FCPID		FcpId;			/* WWN valid only if type is
388fcf3ce4John Forte						 * to WWN, FcpLun always valid */
389fcf3ce4John Forte    HBA_UINT32		FcId;
390fcf3ce4John Forte} HBA_FCPBINDINGENTRY, *PHBA_FCPBINDINGENTRY;
391fcf3ce4John Forte
392fcf3ce4John Fortetypedef struct HBA_FCPBinding {
393fcf3ce4John Forte    HBA_UINT32		NumberOfEntries;
394fcf3ce4John Forte    HBA_FCPBINDINGENTRY	entry[1];		/* Variable length array */
395fcf3ce4John Forte} HBA_FCPBINDING, *PHBA_FCPBINDING;
396fcf3ce4John Forte
397fcf3ce4John Forte/* 4.2.11	FC-3 Management Atrributes */
398fcf3ce4John Forte
399fcf3ce4John Fortetypedef enum HBA_wwntype { NODE_WWN, PORT_WWN } HBA_WWNTYPE;
400fcf3ce4John Forte
401fcf3ce4John Fortetypedef struct HBA_MgmtInfo {
402fcf3ce4John Forte    HBA_WWN		wwn;
403fcf3ce4John Forte    HBA_UINT32		unittype;
404fcf3ce4John Forte    HBA_UINT32		PortId;
405fcf3ce4John Forte    HBA_UINT32		NumberOfAttachedNodes;
406fcf3ce4John Forte    HBA_UINT16		IPVersion;
407fcf3ce4John Forte    HBA_UINT16		UDPPort;
408fcf3ce4John Forte    HBA_UINT8		IPAddress[16];
409fcf3ce4John Forte    HBA_UINT16		reserved;
410fcf3ce4John Forte    HBA_UINT16		TopologyDiscoveryFlags;
411fcf3ce4John Forte} HBA_MGMTINFO, *PHBA_MGMTINFO;
412fcf3ce4John Forte
413fcf3ce4John Forte/* Event Codes */
414fcf3ce4John Forte#define HBA_EVENT_LIP_OCCURRED		1
415fcf3ce4John Forte#define HBA_EVENT_LINK_UP		2
416fcf3ce4John Forte#define HBA_EVENT_LINK_DOWN		3
417fcf3ce4John Forte#define HBA_EVENT_LIP_RESET_OCCURRED	4
418fcf3ce4John Forte#define HBA_EVENT_RSCN			5
419fcf3ce4John Forte#define HBA_EVENT_PROPRIETARY		0xFFFF
420fcf3ce4John Forte
421fcf3ce4John Fortetypedef struct HBA_Link_EventInfo {
422fcf3ce4John Forte    HBA_UINT32		PortFcId;		/* Port where event occurred */
423fcf3ce4John Forte    HBA_UINT32		Reserved[3];
424fcf3ce4John Forte} HBA_LINK_EVENTINFO, *PHBA_LINK_EVENTINFO;
425fcf3ce4John Forte
426fcf3ce4John Fortetypedef struct HBA_RSCN_EventInfo {
427fcf3ce4John Forte    HBA_UINT32		PortFcId;		/* Port where event occurred */
428fcf3ce4John Forte    HBA_UINT32		NPortPage;		/* Reference FC-FS for RSCN ELS
429fcf3ce4John Forte						 * "Affected N-Port Pages"*/
430fcf3ce4John Forte    HBA_UINT32		Reserved[2];
431fcf3ce4John Forte} HBA_RSCN_EVENTINFO, *PHBA_RSCN_EVENTINFO;
432fcf3ce4John Forte
433fcf3ce4John Fortetypedef struct HBA_Pty_EventInfo {
434fcf3ce4John Forte    HBA_UINT32 PtyData[4];			/* Proprietary data */
435fcf3ce4John Forte} HBA_PTY_EVENTINFO, *PHBA_PTY_EVENTINFO;
436fcf3ce4John Forte
437fcf3ce4John Fortetypedef struct HBA_EventInfo {
438fcf3ce4John Forte    HBA_UINT32		EventCode;
439fcf3ce4John Forte    union {
440fcf3ce4John Forte	HBA_LINK_EVENTINFO	Link_EventInfo;
441fcf3ce4John Forte	HBA_RSCN_EVENTINFO	RSCN_EventInfo;
442fcf3ce4John Forte	HBA_PTY_EVENTINFO	Pty_EventInfo;
443fcf3ce4John Forte    }			Event;
444fcf3ce4John Forte} HBA_EVENTINFO, *PHBA_EVENTINFO;
445fcf3ce4John Forte
446fcf3ce4John Fortetypedef struct HBA_LibraryAttributes {
447fcf3ce4John Forte    HBA_BOOLEAN		final;
448fcf3ce4John Forte    char		LibPath[256];
449fcf3ce4John Forte    char		VName[256];
450fcf3ce4John Forte    char		VVersion[256];
451fcf3ce4John Forte    struct tm		build_date;
452fcf3ce4John Forte} HBA_LIBRARYATTRIBUTES, *PHBA_LIBRARYATTRIBUTES;
453fcf3ce4John Forte
454fcf3ce4John Forte/* Persistant Binding... */
455fcf3ce4John Fortetypedef HBA_UINT32 HBA_BIND_TYPE;
456fcf3ce4John Forte#define HBA_BIND_TO_D_ID		0x0001
457fcf3ce4John Forte#define HBA_BIND_TO_WWPN		0x0002
458fcf3ce4John Forte#define HBA_BIND_TO_WWNN		0x0004
459fcf3ce4John Forte#define HBA_BIND_TO_LUID		0x0008
460fcf3ce4John Forte#define HBA_BIND_TARGETS		0x0800
461fcf3ce4John Forte
462fcf3ce4John Forte/* A bit mask of Rev 2.0 persistent binding capabilities */
463fcf3ce4John Fortetypedef HBA_UINT32 HBA_BIND_CAPABILITY;
464fcf3ce4John Forte/* The following are bit flags indicating persistent binding capabilities */
465fcf3ce4John Forte#define HBA_CAN_BIND_TO_D_ID		0x0001
466fcf3ce4John Forte#define HBA_CAN_BIND_TO_WWPN		0x0002
467fcf3ce4John Forte#define HBA_CAN_BIND_TO_WWNN		0x0004
468fcf3ce4John Forte#define HBA_CAN_BIND_TO_LUID		0x0008
469fcf3ce4John Forte#define HBA_CAN_BIND_ANY_LUNS		0x0400
470fcf3ce4John Forte#define HBA_CAN_BIND_TARGETS		0x0800
471fcf3ce4John Forte#define HBA_CAN_BIND_AUTOMAP		0x1000
472fcf3ce4John Forte#define HBA_CAN_BIND_CONFIGURED		0x2000
473fcf3ce4John Forte
474fcf3ce4John Forte#define HBA_BIND_STATUS_DISABLED	0x00
475fcf3ce4John Forte#define HBA_BIND_STATUS_ENABLED		0x01
476fcf3ce4John Forte
477fcf3ce4John Fortetypedef HBA_UINT32 HBA_BIND_STATUS;
478fcf3ce4John Forte
479fcf3ce4John Forte#define HBA_BIND_EFFECTIVE_AT_REBOOT	0x00
480fcf3ce4John Forte#define HBA_BIND_EFFECTIVE_IMMEDIATE	0x01
481fcf3ce4John Forte
482fcf3ce4John Fortetypedef HBA_UINT32 HBA_BIND_EFFECTIVE;
483fcf3ce4John Forte
484fcf3ce4John Fortetypedef struct HBA_FCPBindingEntry2 {
485fcf3ce4John Forte    HBA_BIND_TYPE	type;
486fcf3ce4John Forte    HBA_SCSIID		ScsiId;
487fcf3ce4John Forte    HBA_FCPID		FcpId;
488fcf3ce4John Forte    HBA_LUID		LUID;
489fcf3ce4John Forte    HBA_STATUS		status;
490fcf3ce4John Forte} HBA_FCPBINDINGENTRY2, *PHBA_FCPBINDINGENTRY2;
491fcf3ce4John Forte
492fcf3ce4John Fortetypedef struct HBA_FcpBinding2 {
493fcf3ce4John Forte    HBA_UINT32		NumberOfEntries;
494fcf3ce4John Forte    HBA_FCPBINDINGENTRY2
495fcf3ce4John Forte			entry[1];	/* Variable length array */
496fcf3ce4John Forte} HBA_FCPBINDING2, *PHBA_FCPBINDING2;
497fcf3ce4John Forte
498fcf3ce4John Forte/* FC-4 Instrumentation */
499fcf3ce4John Fortetypedef struct HBA_FC4Statistics {
500fcf3ce4John Forte    HBA_INT64		InputRequests;
501fcf3ce4John Forte    HBA_INT64		OutputRequests;
502fcf3ce4John Forte    HBA_INT64		ControlRequests;
503fcf3ce4John Forte    HBA_INT64		InputMegabytes;
504fcf3ce4John Forte    HBA_INT64		OutputMegabytes;
505fcf3ce4John Forte} HBA_FC4STATISTICS, *PHBA_FC4STATISTICS;
506fcf3ce4John Forte
507fcf3ce4John Forte
508fcf3ce4John Fortetypedef void *	HBA_CALLBACKHANDLE;
509fcf3ce4John Forte/* Adapter Level Events */
510fcf3ce4John Forte#define HBA_EVENT_ADAPTER_UNKNOWN	0x100
511fcf3ce4John Forte#define HBA_EVENT_ADAPTER_ADD		0x101
512fcf3ce4John Forte#define HBA_EVENT_ADAPTER_REMOVE	0x102
513fcf3ce4John Forte#define HBA_EVENT_ADAPTER_CHANGE	0x103
514fcf3ce4John Forte
515fcf3ce4John Forte/* Port Level Events */
516fcf3ce4John Forte#define HBA_EVENT_PORT_UNKNOWN		0x200
517fcf3ce4John Forte#define HBA_EVENT_PORT_OFFLINE		0x201
518fcf3ce4John Forte#define HBA_EVENT_PORT_ONLINE		0x202
519fcf3ce4John Forte#define HBA_EVENT_PORT_NEW_TARGETS	0x203
520fcf3ce4John Forte#define HBA_EVENT_PORT_FABRIC		0x204
521fcf3ce4John Forte
522fcf3ce4John Forte/* Port Statistics Events */
523fcf3ce4John Forte#define HBA_EVENT_PORT_STAT_THRESHOLD	0x301
524fcf3ce4John Forte#define HBA_EVENT_PORT_STAT_GROWTH	0x302
525fcf3ce4John Forte
526fcf3ce4John Forte/* Target Level Events */
527fcf3ce4John Forte#define HBA_EVENT_TARGET_UNKNOWN	0x400
528fcf3ce4John Forte#define HBA_EVENT_TARGET_OFFLINE	0x401
529fcf3ce4John Forte#define HBA_EVENT_TARGET_ONLINE		0x402
530fcf3ce4John Forte#define HBA_EVENT_TARGET_REMOVED	0x403
531fcf3ce4John Forte
532fcf3ce4John Forte/* Fabric Link  Events */
533fcf3ce4John Forte#define HBA_EVENT_LINK_UNKNOWN		0x500
534fcf3ce4John Forte#define HBA_EVENT_LINK_INCIDENT		0x501
535fcf3ce4John Forte
536fcf3ce4John ForteHBA_API HBA_UINT32 HBA_GetVersion();
537fcf3ce4John Forte
538fcf3ce4John Forte/*
539fcf3ce4John Forte * Make sure HBA_LoadLibrary returns before any other threads
540fcf3ce4John Forte * make calls to the library
541fcf3ce4John Forte */
542fcf3ce4John ForteHBA_API HBA_STATUS HBA_LoadLibrary(void);
543fcf3ce4John Forte
544fcf3ce4John ForteHBA_API HBA_STATUS HBA_FreeLibrary(void);
545fcf3ce4John Forte
546fcf3ce4John ForteHBA_API HBA_UINT32 HBA_GetNumberOfAdapters(void);
547fcf3ce4John Forte
548fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetAdapterName(
549fcf3ce4John Forte    HBA_UINT32		adapterindex,
550fcf3ce4John Forte    char		*adaptername
551fcf3ce4John Forte    );
552fcf3ce4John Forte
553fcf3ce4John ForteHBA_API HBA_HANDLE HBA_OpenAdapter(
554fcf3ce4John Forte    char*		adaptername
555fcf3ce4John Forte    );
556fcf3ce4John Forte
557fcf3ce4John ForteHBA_API HBA_STATUS HBA_OpenAdapterByWWN(
558fcf3ce4John Forte    HBA_HANDLE		*handle,
559fcf3ce4John Forte    HBA_WWN		wwn
560fcf3ce4John Forte    );
561fcf3ce4John Forte
562fcf3ce4John ForteHBA_API void HBA_CloseAdapter(
563fcf3ce4John Forte    HBA_HANDLE		handle
564fcf3ce4John Forte    );
565fcf3ce4John Forte
566fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetAdapterAttributes(
567fcf3ce4John Forte    HBA_HANDLE		handle,
568fcf3ce4John Forte    HBA_ADAPTERATTRIBUTES
569fcf3ce4John Forte			*hbaattributes
570fcf3ce4John Forte    );
571fcf3ce4John Forte
572fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetAdapterPortAttributes(
573fcf3ce4John Forte    HBA_HANDLE		handle,
574fcf3ce4John Forte    HBA_UINT32		portindex,
575fcf3ce4John Forte    HBA_PORTATTRIBUTES	*portattributes
576fcf3ce4John Forte    );
577fcf3ce4John Forte
578fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetPortStatistics(
579fcf3ce4John Forte    HBA_HANDLE		handle,
580fcf3ce4John Forte    HBA_UINT32		portindex,
581fcf3ce4John Forte    HBA_PORTSTATISTICS	*portstatistics
582fcf3ce4John Forte    );
583fcf3ce4John Forte
584fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetDiscoveredPortAttributes(
585fcf3ce4John Forte    HBA_HANDLE		handle,
586fcf3ce4John Forte    HBA_UINT32		portindex,
587fcf3ce4John Forte    HBA_UINT32		discoveredportindex,
588fcf3ce4John Forte    HBA_PORTATTRIBUTES	*portattributes
589fcf3ce4John Forte    );
590fcf3ce4John Forte
591fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetPortAttributesByWWN(
592fcf3ce4John Forte    HBA_HANDLE		handle,
593fcf3ce4John Forte    HBA_WWN		PortWWN,
594fcf3ce4John Forte    HBA_PORTATTRIBUTES	*portattributes
595fcf3ce4John Forte    );
596fcf3ce4John Forte
597fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendCTPassThruV2(
598fcf3ce4John Forte    HBA_HANDLE		handle,
599fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
600fcf3ce4John Forte    void		*pReqBuffer,
601fcf3ce4John Forte    HBA_UINT32		ReqBufferSize,
602fcf3ce4John Forte    void		*pRspBuffer,
603fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
604fcf3ce4John Forte    );
605fcf3ce4John Forte
606fcf3ce4John Forte/* Depricated, but supported */
607fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendCTPassThru(
608fcf3ce4John Forte    HBA_HANDLE		handle,
609fcf3ce4John Forte    void		*pReqBuffer,
610fcf3ce4John Forte    HBA_UINT32		ReqBufferSize,
611fcf3ce4John Forte    void		*pRspBuffer,
612fcf3ce4John Forte    HBA_UINT32		RspBufferSize
613fcf3ce4John Forte    );
614fcf3ce4John Forte
615fcf3ce4John ForteHBA_API void HBA_RefreshAdapterConfiguration();
616fcf3ce4John Forte
617fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetEventBuffer(
618fcf3ce4John Forte    HBA_HANDLE		handle,
619fcf3ce4John Forte    HBA_EVENTINFO	*EventBuffer,
620fcf3ce4John Forte    HBA_UINT32		*EventBufferCount
621fcf3ce4John Forte    );
622fcf3ce4John Forte
623fcf3ce4John ForteHBA_API HBA_STATUS HBA_SetRNIDMgmtInfo(
624fcf3ce4John Forte    HBA_HANDLE		handle,
625fcf3ce4John Forte    HBA_MGMTINFO	Info
626fcf3ce4John Forte    );
627fcf3ce4John Forte
628fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetRNIDMgmtInfo(
629fcf3ce4John Forte    HBA_HANDLE		handle,
630fcf3ce4John Forte    HBA_MGMTINFO	*pInfo
631fcf3ce4John Forte    );
632fcf3ce4John Forte
633fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendRNIDV2(
634fcf3ce4John Forte    HBA_HANDLE		handle,
635fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
636fcf3ce4John Forte    HBA_WWN		destWWN,
637fcf3ce4John Forte    HBA_UINT32		destFCID,
638fcf3ce4John Forte    HBA_UINT32		NodeIdDataFormat,
639fcf3ce4John Forte    void		*pRspBuffer,
640fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
641fcf3ce4John Forte    );
642fcf3ce4John Forte
643fcf3ce4John Forte/* Depricated, but supported */
644fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendRNID(
645fcf3ce4John Forte    HBA_HANDLE		handle,
646fcf3ce4John Forte    HBA_WWN		wwn,
647fcf3ce4John Forte    HBA_WWNTYPE		wwntype,
648fcf3ce4John Forte    void		*pRspBuffer,
649fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
650fcf3ce4John Forte    );
651fcf3ce4John Forte
652fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendRLS (
653fcf3ce4John Forte    HBA_HANDLE		handle,
654fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
655fcf3ce4John Forte    HBA_WWN		destWWN,
656fcf3ce4John Forte    void		*pRspBuffer,
657fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
658fcf3ce4John Forte    );
659fcf3ce4John Forte
660fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendRPL (
661fcf3ce4John Forte    HBA_HANDLE		handle,
662fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
663fcf3ce4John Forte    HBA_WWN		agent_wwn,
664fcf3ce4John Forte    HBA_UINT32		agent_domain,
665fcf3ce4John Forte    HBA_UINT32		portindex,
666fcf3ce4John Forte    void		*pRspBuffer,
667fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
668fcf3ce4John Forte    );
669fcf3ce4John Forte
670fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendRPS (
671fcf3ce4John Forte    HBA_HANDLE		handle,
672fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
673fcf3ce4John Forte    HBA_WWN		agent_wwn,
674fcf3ce4John Forte    HBA_UINT32		agent_domain,
675fcf3ce4John Forte    HBA_WWN		object_wwn,
676fcf3ce4John Forte    HBA_UINT32		object_port_number,
677fcf3ce4John Forte    void		*pRspBuffer,
678fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
679fcf3ce4John Forte    );
680fcf3ce4John Forte
681fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendSRL (
682fcf3ce4John Forte    HBA_HANDLE		handle,
683fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
684fcf3ce4John Forte    HBA_WWN		wwn,
685fcf3ce4John Forte    HBA_UINT32		domain,
686fcf3ce4John Forte    void		*pRspBuffer,
687fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
688fcf3ce4John Forte    );
689fcf3ce4John Forte
690fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendLIRR (
691fcf3ce4John Forte    HBA_HANDLE		handle,
692fcf3ce4John Forte    HBA_WWN		sourceWWN,
693fcf3ce4John Forte    HBA_WWN		destWWN,
694fcf3ce4John Forte    HBA_UINT8		function,
695fcf3ce4John Forte    HBA_UINT8		type,
696fcf3ce4John Forte    void		*pRspBuffer,
697fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize
698fcf3ce4John Forte    );
699fcf3ce4John Forte
700fcf3ce4John Forte
701fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetFC4Statistics (
702fcf3ce4John Forte    HBA_HANDLE		handle,
703fcf3ce4John Forte    HBA_WWN		portWWN,
704fcf3ce4John Forte    HBA_UINT8		FC4type,
705fcf3ce4John Forte    HBA_FC4STATISTICS	*pstatistics
706fcf3ce4John Forte    );
707fcf3ce4John Forte
708fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetFCPStatistics (
709fcf3ce4John Forte    HBA_HANDLE		handle,
710fcf3ce4John Forte    const HBA_SCSIID	*lunit,
711fcf3ce4John Forte    HBA_FC4STATISTICS	*pstatistics);
712fcf3ce4John Forte
713fcf3ce4John ForteHBA_API void HBA_RefreshInformation(
714fcf3ce4John Forte    HBA_HANDLE		handle
715fcf3ce4John Forte    );
716fcf3ce4John Forte
717fcf3ce4John ForteHBA_API void HBA_ResetStatistics(
718fcf3ce4John Forte    HBA_HANDLE		handle,
719fcf3ce4John Forte    HBA_UINT32		portindex
720fcf3ce4John Forte    );
721fcf3ce4John Forte
722fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetFcpTargetMapping(
723fcf3ce4John Forte    HBA_HANDLE		handle,
724fcf3ce4John Forte    HBA_FCPTARGETMAPPING
725fcf3ce4John Forte			*pmapping
726fcf3ce4John Forte    );
727fcf3ce4John Forte
728fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetFcpTargetMappingV2(
729fcf3ce4John Forte    HBA_HANDLE		handle,
730fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
731fcf3ce4John Forte    HBA_FCPTARGETMAPPINGV2
732fcf3ce4John Forte			*pmapping
733fcf3ce4John Forte    );
734fcf3ce4John Forte
735fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetBindingCapability(
736fcf3ce4John Forte    HBA_HANDLE		handle,
737fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
738fcf3ce4John Forte    HBA_BIND_CAPABILITY *pcapability
739fcf3ce4John Forte    );
740fcf3ce4John Forte
741fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetBindingSupport(
742fcf3ce4John Forte    HBA_HANDLE		handle,
743fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
744fcf3ce4John Forte    HBA_BIND_CAPABILITY *pcapability
745fcf3ce4John Forte    );
746fcf3ce4John Forte
747fcf3ce4John ForteHBA_API HBA_STATUS HBA_SetBindingSupport(
748fcf3ce4John Forte    HBA_HANDLE		handle,
749fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
750fcf3ce4John Forte    HBA_BIND_CAPABILITY capability
751fcf3ce4John Forte    );
752fcf3ce4John Forte
753fcf3ce4John ForteHBA_API HBA_STATUS HBA_SetPersistentBindingV2(
754fcf3ce4John Forte    HBA_HANDLE		handle,
755fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
756fcf3ce4John Forte    const HBA_FCPBINDING2
757fcf3ce4John Forte			*pbinding
758fcf3ce4John Forte    );
759fcf3ce4John Forte
760fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetPersistentBindingV2(
761fcf3ce4John Forte    HBA_HANDLE		handle,
762fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
763fcf3ce4John Forte    HBA_FCPBINDING2	*binding
764fcf3ce4John Forte    );
765fcf3ce4John Forte
766fcf3ce4John ForteHBA_API HBA_STATUS HBA_RemovePersistentBinding(
767fcf3ce4John Forte    HBA_HANDLE		handle,
768fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
769fcf3ce4John Forte    const HBA_FCPBINDING2
770fcf3ce4John Forte			*pbinding
771fcf3ce4John Forte    );
772fcf3ce4John Forte
773fcf3ce4John Forte/* Depricated, but supported */
774fcf3ce4John ForteHBA_API HBA_STATUS HBA_GetFcpPersistentBinding(
775fcf3ce4John Forte    HBA_HANDLE		handle,
776fcf3ce4John Forte    HBA_FCPBINDING	*binding
777fcf3ce4John Forte    );
778fcf3ce4John Forte
779fcf3ce4John ForteHBA_API HBA_STATUS HBA_RemoveAllPersistentBindings(
780fcf3ce4John Forte    HBA_HANDLE		handle,
781fcf3ce4John Forte    HBA_WWN		hbaPortWWN
782fcf3ce4John Forte    );
783fcf3ce4John Forte
784fcf3ce4John ForteHBA_STATUS HBA_ScsiInquiryV2 (
785fcf3ce4John Forte    HBA_HANDLE		handle,
786fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
787fcf3ce4John Forte    HBA_WWN		discoveredPortWWN,
788fcf3ce4John Forte    HBA_UINT64		fcLUN,
789fcf3ce4John Forte    HBA_UINT8		CDB_Byte1,
790fcf3ce4John Forte    HBA_UINT8		CDB_BYte2,
791fcf3ce4John Forte    void		*pRspBuffer,
792fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize,
793fcf3ce4John Forte    HBA_UINT8		*pScsiStatus,
794fcf3ce4John Forte    void		*pSenseBuffer,
795fcf3ce4John Forte    HBA_UINT32		*pSenseBufferSize
796fcf3ce4John Forte    );
797fcf3ce4John Forte
798fcf3ce4John Forte/* Depricated, but supported */
799fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendScsiInquiry (
800fcf3ce4John Forte    HBA_HANDLE		handle,
801fcf3ce4John Forte    HBA_WWN		PortWWN,
802fcf3ce4John Forte    HBA_UINT64		fcLUN,
803fcf3ce4John Forte    HBA_UINT8		EVPD,
804fcf3ce4John Forte    HBA_UINT32		PageCode,
805fcf3ce4John Forte    void		*pRspBuffer,
806fcf3ce4John Forte    HBA_UINT32		RspBufferSize,
807fcf3ce4John Forte    void		*pSenseBuffer,
808fcf3ce4John Forte    HBA_UINT32		SenseBufferSize
809fcf3ce4John Forte    );
810fcf3ce4John Forte
811fcf3ce4John ForteHBA_API HBA_STATUS HBA_ScsiReportLUNsV2(
812fcf3ce4John Forte    HBA_HANDLE		handle,
813fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
814fcf3ce4John Forte    HBA_WWN		discoveredPortWWN,
815fcf3ce4John Forte    void		*pRespBuffer,
816fcf3ce4John Forte    HBA_UINT32		*pRespBufferSize,
817fcf3ce4John Forte    HBA_UINT8		*pScsiStatus,
818fcf3ce4John Forte    void		*pSenseBuffer,
819fcf3ce4John Forte    HBA_UINT32		*pSenseBufferSize
820fcf3ce4John Forte    );
821fcf3ce4John Forte
822fcf3ce4John Forte/* Depricated, but supported */
823fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendReportLUNs (
824fcf3ce4John Forte    HBA_HANDLE		handle,
825fcf3ce4John Forte    HBA_WWN		portWWN,
826fcf3ce4John Forte    void		*pRspBuffer,
827fcf3ce4John Forte    HBA_UINT32		RspBufferSize,
828fcf3ce4John Forte    void		*pSenseBuffer,
829fcf3ce4John Forte    HBA_UINT32		SenseBufferSize
830fcf3ce4John Forte    );
831fcf3ce4John Forte
832fcf3ce4John ForteHBA_API HBA_STATUS HBA_ScsiReadCapacityV2(
833fcf3ce4John Forte    HBA_HANDLE		handle,
834fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
835fcf3ce4John Forte    HBA_WWN		discoveredPortWWN,
836fcf3ce4John Forte    HBA_UINT64		fcLUN,
837fcf3ce4John Forte    void		*pRspBuffer,
838fcf3ce4John Forte    HBA_UINT32		*pRspBufferSize,
839fcf3ce4John Forte    HBA_UINT8		*pScsiStatus,
840fcf3ce4John Forte    void		*pSenseBuffer,
841fcf3ce4John Forte    HBA_UINT32		*SenseBufferSize
842fcf3ce4John Forte    );
843fcf3ce4John Forte
844fcf3ce4John Forte/* Depricated, but supported */
845fcf3ce4John ForteHBA_API HBA_STATUS HBA_SendReadCapacity (
846fcf3ce4John Forte    HBA_HANDLE		handle,
847fcf3ce4John Forte    HBA_WWN		portWWN,
848fcf3ce4John Forte    HBA_UINT64		fcLUN,
849fcf3ce4John Forte    void		*pRspBuffer,
850fcf3ce4John Forte    HBA_UINT32		RspBufferSize,
851fcf3ce4John Forte    void		*pSenseBuffer,
852fcf3ce4John Forte    HBA_UINT32		SenseBufferSize
853fcf3ce4John Forte    );
854fcf3ce4John Forte
855fcf3ce4John ForteHBA_API HBA_UINT32 HBA_GetVendorLibraryAttributes (
856fcf3ce4John Forte    HBA_UINT32		adapter_index,
857fcf3ce4John Forte    HBA_LIBRARYATTRIBUTES
858fcf3ce4John Forte			*attributes
859fcf3ce4John Forte    );
860fcf3ce4John Forte
861fcf3ce4John ForteHBA_API HBA_STATUS HBA_RemoveCallback(
862fcf3ce4John Forte    HBA_CALLBACKHANDLE	callbackHandle
863fcf3ce4John Forte    );
864fcf3ce4John Forte
865fcf3ce4John ForteHBA_API HBA_STATUS HBA_RegisterForAdapterAddEvents(
866fcf3ce4John Forte    void		(*callback) (
867fcf3ce4John Forte	void		*data,
868fcf3ce4John Forte	HBA_WWN		PortWWN,
869fcf3ce4John Forte	HBA_UINT32	eventType
870fcf3ce4John Forte	),
871fcf3ce4John Forte    void		*userData,
872fcf3ce4John Forte    HBA_CALLBACKHANDLE *callbackHandle
873fcf3ce4John Forte    );
874fcf3ce4John Forte
875fcf3ce4John ForteHBA_API HBA_STATUS HBA_RegisterForAdapterEvents(
876fcf3ce4John Forte    void		(*callback)(
877fcf3ce4John Forte	void		*data,
878fcf3ce4John Forte	HBA_WWN		PortWWN,
879fcf3ce4John Forte	HBA_UINT32	eventType
880fcf3ce4John Forte	),
881fcf3ce4John Forte    void		*userData,
882fcf3ce4John Forte    HBA_HANDLE		handle,
883fcf3ce4John Forte    HBA_CALLBACKHANDLE	*callbackHandle
884fcf3ce4John Forte    );
885fcf3ce4John Forte
886fcf3ce4John ForteHBA_API HBA_STATUS HBA_RegisterForAdapterPortEvents(
887fcf3ce4John Forte    void		(*callback)(
888fcf3ce4John Forte	void		*data,
889fcf3ce4John Forte	HBA_WWN		PortWWN,
890fcf3ce4John Forte	HBA_UINT32	eventType,
891fcf3ce4John Forte	HBA_UINT32	fabricPortID
892fcf3ce4John Forte	),
893fcf3ce4John Forte    void		*userData,
894fcf3ce4John Forte    HBA_HANDLE		handle,
895fcf3ce4John Forte    HBA_WWN		PortWWN,
896fcf3ce4John Forte    HBA_CALLBACKHANDLE *callbackHandle
897fcf3ce4John Forte    );
898fcf3ce4John Forte
899fcf3ce4John ForteHBA_API HBA_STATUS HBA_RegisterForAdapterPortStatEvents(
900fcf3ce4John Forte    void		(*callback)(
901fcf3ce4John Forte	void		*data,
902fcf3ce4John Forte	HBA_WWN		PortWWN,
903fcf3ce4John Forte	HBA_UINT32	eventType
904fcf3ce4John Forte	),
905fcf3ce4John Forte    void		*userData,
906fcf3ce4John Forte    HBA_HANDLE		handle,
907fcf3ce4John Forte    HBA_WWN		PortWWN,
908fcf3ce4John Forte    HBA_PORTSTATISTICS	stats,
909fcf3ce4John Forte    HBA_UINT32		statType,
910fcf3ce4John Forte    HBA_CALLBACKHANDLE	*callbackHandle
911fcf3ce4John Forte    );
912fcf3ce4John Forte
913fcf3ce4John Forte
914fcf3ce4John ForteHBA_API HBA_STATUS HBA_RegisterForTargetEvents(
915fcf3ce4John Forte    void		(*callback)(
916fcf3ce4John Forte	void		*data,
917fcf3ce4John Forte	HBA_WWN		hbaPortWWN,
918fcf3ce4John Forte	HBA_WWN		discoveredPortWWN,
919fcf3ce4John Forte	HBA_UINT32	eventType
920fcf3ce4John Forte	),
921fcf3ce4John Forte    void		*userData,
922fcf3ce4John Forte    HBA_HANDLE		handle,
923fcf3ce4John Forte    HBA_WWN		hbaPortWWN,
924fcf3ce4John Forte    HBA_WWN		discoveredPortWWN,
925fcf3ce4John Forte    HBA_CALLBACKHANDLE	*callbackHandle,
926fcf3ce4John Forte    HBA_UINT32		allTargets
927fcf3ce4John Forte    );
928fcf3ce4John Forte
929fcf3ce4John ForteHBA_API HBA_STATUS HBA_RegisterForLinkEvents(
930fcf3ce4John Forte    void		(*callback)
931fcf3ce4John Forte    (
932fcf3ce4John Forte	void		*data,
933fcf3ce4John Forte	HBA_WWN		adapterWWN,
934fcf3ce4John Forte	HBA_UINT32	eventType,
935fcf3ce4John Forte	void		*pRLIRBuffer,
936fcf3ce4John Forte	HBA_UINT32	RLIRBufferSize
937fcf3ce4John Forte	),
938fcf3ce4John Forte    void		*userData,
939fcf3ce4John Forte    void		*pRLIRBuffer,
940fcf3ce4John Forte    HBA_UINT32		RLIRBufferSize,
941fcf3ce4John Forte    HBA_HANDLE		handle,
942fcf3ce4John Forte    HBA_CALLBACKHANDLE	*callbackHandle
943fcf3ce4John Forte);
944fcf3ce4John Forte
945fcf3ce4John Forte/* Wrapper library specific entry points */
946fcf3ce4John Forte
947fcf3ce4John ForteHBA_API HBA_UINT32 HBA_GetWrapperLibraryAttributes (
948fcf3ce4John Forte    HBA_LIBRARYATTRIBUTES
949fcf3ce4John Forte			*attributes
950fcf3ce4John Forte);
951fcf3ce4John Forte
952fcf3ce4John Forte#endif /* HBA_API_H */
953fcf3ce4John Forte
954fcf3ce4John Forte#ifdef __cplusplus
955fcf3ce4John Forte}
956fcf3ce4John Forte#endif
957fcf3ce4John Forte
958fcf3ce4John Forte
959