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